How to Configure Apache to run PHP Scripts on linux

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kodaliece@gmail.com

    How to Configure Apache to run PHP Scripts on linux

    Hi,

    I am new to this PHP and linux OS as well. I am trying to install to
    Apache 2.2.8 and PHP 5.2.5 and do some PHP coding. I've installed
    Apache and tested it. Its working fine. Then, I installed PHP 5.2.5.
    The command I used to configure is
    ../configure \
    -with-apxs2=/usr/local/apache2/bin/apxs

    After Installing PHP, I am not able to stop/start Apache. The error
    is:
    httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf:
    Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/
    local/apache2/modules/libphp5.so: undefined symbol:
    php_ini_opened_ path.

    Then I surfed some groups in net and and tried the following changes
    to 'httpd.conf' file:
    [Deleted] LoadModule php5_module modules/libphp5.so
    [ADDED]
    <IfModule dir_module>
    DirectoryIndex index.php default.php index.html index.htm
    </IfModule>

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    AddType application/x-httpd-php .php .php3
    [/ADDED]

    Then I installed PHP again. As a result, "LoadModule php5_module
    modules/libphp5.so" line got added in the httpd.conf file
    automatically at line no 53. Still I face the same error which I
    mentioned earlier.

    Again I googled and did the following changes in addition to the
    previous changes:
    Copied the 'php.ini-dist' file to the location "/usr/local/lib/" and
    renamed it to 'php.ini'
    Still my Apache is not starting.

    Then I removed the line "LoadModule php5_module modules/libphp5.so"
    from 'httpd.conf' file and tried to start Apache. This time I am able
    to start and stop apache. But I cannot run PHP scripts.

    It seems like the problem is with the 'libphp5.so' file which
    automatically gets created with PHP installation. Can anyone provide
    me solution for this.

    Thanks
    Mohan
  • =?ISO-8859-15?Q?Iv=E1n_S=E1nchez_Ortega?=

    #2
    Re: How to Configure Apache to run PHP Scripts on linux

    kodaliece@gmail .com wrote:
    I am new to this PHP and linux OS as well.
    OK, now tell us what distribution you're using here, please.

    --
    ----------------------------------
    Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

    In a museum in Havana, there are two skulls of Christopher Columbus,
    "one when he was a boy and one when he was a man."
    -- Mark Twain

    Comment

    Working...