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

Thread: Apache2 not processing PHP5 in openSUSE 12.2

  1. #1
    Join Date
    Jun 2008
    Location
    Pacific Northwest
    Posts
    371

    Default Apache2 not processing PHP5 in openSUSE 12.2

    Attempting to set up a LAMP server. Installed the LAMP files from YaST patterns "Web and Lamp Server".
    Apache works. Apache also displays HTML files. Apache doesn't process PHP5. The test code is as follows:

    <html>
    <head>
    <title>PHP Test</title>
    <body>
    html works<br>
    <?php
    phpinfo();
    ?>
    </body>
    </html>

    ---------------
    The result indicates "html works". There is no display for phpinfo().
    The greatest obstacle to discovery is not ignorance, it is the illusion of knowledge.
    Daniel J. Boorstin US Patent Office

  2. #2
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,061

    Default Re: Apache2 not processing PHP5 in openSUSE 12.2

    On Thu, 06 Dec 2012 23:46:02 +0000, Parthenolide wrote:

    > Attempting to set up a LAMP server. Installed the LAMP files from YaST
    > patterns "Web and Lamp Server".
    > Apache works. Apache also displays HTML files. Apache doesn't process
    > PHP5. The test code is as follows:


    What configuration have you done beyond installation to enable PHP?

    Jim
    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  3. #3
    Join Date
    Jun 2008
    Location
    Pacific Northwest
    Posts
    371

    Default Re: Apache2 not processing PHP5 in openSUSE 12.2

    Good question. I didn't know any configuration was required. Is there a guide?
    The greatest obstacle to discovery is not ignorance, it is the illusion of knowledge.
    Daniel J. Boorstin US Patent Office

  4. #4
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,061

    Default Re: Apache2 not processing PHP5 in openSUSE 12.2

    On Fri, 07 Dec 2012 01:26:01 +0000, Parthenolide wrote:

    > Good question. I didn't know any configuration was required. Is there a
    > guide?


    A quick google turned up this:

    http://www.howtoforge.com/installing...mysql-support-
    on-opensuse-11.2-lamp

    It's for 11.2 but the principles should be very similar, as apache and php
    haven't changed much.

    Jim


    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  5. #5
    Join Date
    Jun 2008
    Location
    Pacific Northwest
    Posts
    371

    Default Re: Apache2 not processing PHP5 in openSUSE 12.2

    The link wasn't all that helpful.
    I tried the following link: https://en.opensuse.org/SDB:Linux_Apache_MySQL_PHP
    Again, not all that helpful.

    #ls /etc/apache2
    There is no mod_php.conf file. Looking through httpd.conf, there also is no include statement for PHP. My guess is that this is the problem. However, none of the on-line guides discuss this. Any help would appreciated.
    The greatest obstacle to discovery is not ignorance, it is the illusion of knowledge.
    Daniel J. Boorstin US Patent Office

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,842
    Blog Entries
    15

    Default Re: Apache2 not processing PHP5 in openSUSE 12.2

    On Tue 11 Dec 2012 10:56:01 PM CST, Parthenolide wrote:


    The link wasn't all that helpful.
    I tried the following link:
    https://en.opensuse.org/SDB:Linux_Apache_MySQL_PHP
    Again, not all that helpful.

    #ls /etc/apache2
    There is no mod_php.conf file. Looking through httpd.conf, there also
    is no include statement for PHP. My guess is that this is the problem.
    However, none of the on-line guides discuss this. Any help would
    appreciated.


    Hi
    Use fgrep....
    Code:
    cd /etc/apache2
    fgrep -r php *
    
    conf.d/php5.conf:<IfModule mod_php5.c>
    conf.d/php5.conf:           SetHandler application/x-httpd-php
    conf.d/php5.conf:       <FilesMatch "\.php[345]?s$">
    conf.d/php5.conf:           SetHandler application/x-httpd-php-source
    conf.d/php5.conf:        DirectoryIndex index.php4
    conf.d/php5.conf:        DirectoryIndex index.php5
    conf.d/php5.conf:        DirectoryIndex index.php
    httpd.conf:#  |   |-- mod_php4.conf . . . . . . . . . .  (example) conf that comes with apache2-mod_php4
    mime.types:application/x-php php php3 php4
    sysconfig.d/loadmodule.conf:LoadModule php5_module                    /usr/lib/apache2/mod_php5.so
    vhosts.d/vhost.template:    # Include /etc/apache2/conf.d/mod_php4.conf
    vhosts.d/vhost-ssl.template:	<Files ~"\.(cgi|shtml|phtml|php3?)$">
    So if it's not in the sysconfig.d file to load.....


    --
    Cheers Malcolm °¿° (Linux Counter #276890)
    openSUSE 12.2 (x86_64) Kernel 3.4.11-2.16-desktop
    up 2:12, 3 users, load average: 2.32, 2.11, 1.53
    CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU


  7. #7
    Join Date
    Jun 2008
    Location
    Pacific Northwest
    Posts
    371

    Default Re: Apache2 not processing PHP5 in openSUSE 12.2

    here is the result of
    cd /etc/apache2
    fgrep -r php *

    conf.d/php5.conf:<IfModule mod_php5.c>
    conf.d/php5.conf: SetHandler application/x-httpd-php
    conf.d/php5.conf: <FilesMatch "\.php[345]?s$">
    conf.d/php5.conf: SetHandler application/x-httpd-php-source
    conf.d/php5.conf: DirectoryIndex index.php4
    conf.d/php5.conf: DirectoryIndex index.php5
    conf.d/php5.conf: DirectoryIndex index.php
    default-vhost.conf: # Include /etc/apache2/conf.d/mod_php4.conf
    default-vhost-ssl.conf: <FilesMatch "\.(cgi|shtml|phtml|php)$">
    httpd.conf:# | |-- mod_php4.conf . . . . . . . . . . (example) conf that comes with apache2-mod_php4
    mime.types:application/x-php php php3 php4
    sysconfig.d/loadmodule.conf:LoadModule php5_module /usr/lib64/apache2/mod_php5.so
    vhosts.d/vhost-ssl.template: <FilesMatch "\.(cgi|shtml|phtml|php)$">
    vhosts.d/vhost.template: # Include /etc/apache2/conf.d/php5.conf

    -------------------------
    It looks like I have two more lines
    The greatest obstacle to discovery is not ignorance, it is the illusion of knowledge.
    Daniel J. Boorstin US Patent Office

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,842
    Blog Entries
    15

    Default Re: Apache2 not processing PHP5 in openSUSE 12.2

    Hi
    So the module should be loaded, do you see php5_module (shared) in the output from;
    Code:
    apache2ctl -M
    If not, check in YaST -> /etc/sysconfig editor under Network->WWW->Apache2 APACHE_MODULES php5 is in the list?
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #9
    Join Date
    Jun 2008
    Location
    Pacific Northwest
    Posts
    371

    Default Re: Apache2 not processing PHP5 in openSUSE 12.2

    Thanks for the help Malcolm.
    Here is the output from running the suggested code.
    ----------------------------------------------------------------
    linux-xxx:/etc/apache2 # apache2ctl -M
    httpd2: apr_sockaddr_info_get() failed for linux-t6xe
    httpd2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    Loaded Modules:
    core_module (static)
    mpm_prefork_module (static)
    http_module (static)
    so_module (static)
    actions_module (shared)
    alias_module (shared)
    auth_basic_module (shared)
    authn_file_module (shared)
    authz_host_module (shared)
    authz_groupfile_module (shared)
    authz_default_module (shared)
    authz_user_module (shared)
    autoindex_module (shared)
    cgi_module (shared)
    dir_module (shared)
    env_module (shared)
    expires_module (shared)
    include_module (shared)
    log_config_module (shared)
    mime_module (shared)
    negotiation_module (shared)
    setenvif_module (shared)
    ssl_module (shared)
    userdir_module (shared)
    php5_module (shared)
    reqtimeout_module (shared)
    Syntax OK
    ------------------------
    Here is the html test page

    <html>
    <head>
    <title>PHP Test</title>
    <body>
    html works<br>
    <?php
    phpinfo();
    ?>
    </body>
    </html>

    -------------
    It displays "html works", and nothing else.

    Any help would be appreciated.
    The greatest obstacle to discovery is not ignorance, it is the illusion of knowledge.
    Daniel J. Boorstin US Patent Office

  10. #10
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,842
    Blog Entries
    15

    Default Re: Apache2 not processing PHP5 in openSUSE 12.2

    Hi
    Strange indeed, not sure if the error you see about the FQDN is causing an issue... any reason not to correct that?

    Are you running vhosts?

    Your test page works fine here on my server... assuming it's being saved as somename.php.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

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
  •