Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: PHP Issue

  1. #1

    Question PHP Issue

    Hi, I have a little office webserver set up and I am having an issue with PHP files (PHP is installed and loaded and the files are .php files) not being able to be utilized by the web browsers but instead want to be opened with a text editor. I have a new installation of OpenSuse 11.2 and I installed PHP and Apache during setup. Anyone got an idea? I can show conf files if needed.

  2. #2

    Default Re: PHP Issue

    PHP file must start with <?php
    or there is a setting in the php.ini file that allow you to use only <?
    as the starting mark.

  3. #3

    Default Re: PHP Issue

    Yea, I'm set for short tags but if I try to open the test.php (phpinfo file) in a web browser, it just wants to open it in a text editor. It's like that for all php files.

  4. #4

    Default Re: PHP Issue

    Quote Originally Posted by mdskinner View Post
    Yea, I'm set for short tags but if I try to open the test.php (phpinfo file) in a web browser, it just wants to open it in a text editor. It's like that for all php files.
    fist, did you install the package apache2-mod_php5 ?

    if no, the let me tell you that installing the package php will only install a cli version of php while the above package is the apache integration.

    if yes, can you confirm that there is a file /etc/apache2/conf.d/php5.conf with the following content?

    Code:
    <IfModule mod_php5.c>
            AddHandler application/x-httpd-php .php4
            AddHandler application/x-httpd-php .php5
            AddHandler application/x-httpd-php .php
            AddHandler application/x-httpd-php-source .php4s
            AddHandler application/x-httpd-php-source .php5s
            AddHandler application/x-httpd-php-source .phps
            DirectoryIndex index.php4
            DirectoryIndex index.php5
            DirectoryIndex index.php
    </IfModule>
    if not, add it.

  5. #5

    Default Re: PHP Issue

    Here's that file on my system.

    <IfModule mod_php5.c>
    AddHandler application/x-httpd-php .php4
    AddHandler application/x-httpd-php .php5
    AddHandler application/x-httpd-php .php
    AddHandler application/x-httpd-php-source .php4s
    AddHandler application/x-httpd-php-source .php5s
    AddHandler application/x-httpd-php-source .phps
    DirectoryIndex index.php4
    DirectoryIndex index.php5
    DirectoryIndex index.php
    </IfModule>

  6. #6

    Default Re: PHP Issue

    I'm using GUI for most of this. I'm just more comfortable with it. Anyway, the files that are ".php" (such as test.php) are shown with a PHP icon in the file manager, if that helps.

  7. #7

    Default Re: PHP Issue

    mhh strange...

    can you post the following outputs (terminal)?

    zypper se apache2-mod_php5
    Code:
    grep php < /etc/apache2/sysconfig.d/loadmodule.conf

  8. #8
    Join Date
    Jun 2008
    Location
    /dev/belgium
    Posts
    1,946

    Default Re: PHP Issue

    Are you using user directories to serve the pages, ie /home/username/public_html? If so, by default, php is NOT enabled and you need to enable it in the apache's mod_userdir.conf file.

    Also post your default-server.conf file and httpd.conf

    PS: you should REALLY AVOID using php short-tags

  9. #9

    Default Re: PHP Issue

    webserver:~ # zypper se apache2-mod_php5
    Retrieving repository 'Updates for openSUSE 11.2-0' metadata [done]
    Building repository 'Updates for openSUSE 11.2-0' cache [done]
    Loading repository data...
    Reading installed packages...

    S | Name | Summary | Type
    --+------------------+----------------------------+--------
    i | apache2-mod_php5 | PHP5 Module for Apache 2.0 | package
    webserver:~ #

  10. #10

    Default Re: PHP Issue

    webserver:~ # grep php < /etc/apache2/sysconfig.d/loadmodule.conf
    LoadModule php5_module /usr/lib/apache2/mod_php5.so
    webserver:~ #

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •