By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,751 Members | 1,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,751 IT Pros & Developers. It's quick & easy.

How to Configure Apache to run PHP Scripts on linux

P: n/a
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
Feb 14 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ko*******@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

Feb 14 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.