Page 1 of 1

Apache failed to startup while integrating php

Posted: Sun Nov 02, 2008 7:33 pm
by novinjaiswal
HI friends,

I am on new bie on linux.

I have integrated PHP 5.2.6 with apache.

when i start the server it is failing and i m getting following error.

Stopping httpd: [FAILED]
Starting httpd: Syntax error on line 6 of /etc/httpd/conf.d/php.conf:
Cannot load /etc/httpd/modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: cannot open shared object file: No such file or directory
[FAILED]


when I checked for the file libphp5.so under /etc/httpd/modules/ i didn't find it.

your help is appreciated

Thanks
Novin

Re: Apache failed to startup while integrating php

Posted: Mon Nov 03, 2008 6:25 am
by VladSun
Try to locate the PHP library:

Code: Select all

find / -name libphp4.so
and accordingly, change it in /etc/httpd/conf.d/php.conf, line 6

Re: Apache failed to startup while integrating php

Posted: Mon Nov 03, 2008 8:23 am
by novinjaiswal
Hi thanks for the reply.

I have already run that command but no such file found.

Is any thing wrong with PHP installation?

I think it will be good idea to unstall PHP and then reinstall.

How can i unstall PHP and then reinstall using rpm?

Pls guide me to solve this problem.

Thanks
Novin

Re: Apache failed to startup while integrating php

Posted: Mon Nov 03, 2008 8:26 am
by VladSun
novinjaiswal wrote:Hi thanks for the reply.

I have already run that command but no such file found.

Is any thing wrong with PHP installation?

I think it will be good idea to unstall PHP and then reinstall.

How can i unstall PHP and then reinstall using rpm?

Pls guide me to solve this problem.

Thanks
Novin
Search for a HOWTO for your distribution - I'm pretty sure it will be more helpful than me ;)

Re: Apache failed to startup while integrating php

Posted: Mon Nov 03, 2008 8:33 am
by novinjaiswal
Hi
just for mre info

when I run following cmd

[root@stage5 /]# /usr/local/php/bin/php -version
PHP 5.2.6 (cli) (built: Jun 5 2008 17:07:46)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies


Thanks
Novin

Re: Apache failed to startup while integrating php

Posted: Mon Nov 03, 2008 11:01 am
by VladSun
It's the PHP CLI (Command Line Interface), not the PHP module used by Apache.

Re: Apache failed to startup while integrating php

Posted: Mon Nov 03, 2008 11:06 am
by novinjaiswal
Hi VladSun,

Thanks For the reply.

Wht it mean i need to change some thing in my php.conf file inside /etc/httpd/conf.d to make it work with apache?

Here is the php.conf
===================================

#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php5_module modules/libphp5.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php .php5
AddType text/html .php .php5

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php index.php5

#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps

Re: Apache failed to startup while integrating php

Posted: Tue Nov 04, 2008 3:20 pm
by VladSun
You need to locate the libphp5.so file - you said you couldn't find it, so your installation is somehow corrupt.
What's your distro? Which howto did you follow?

Re: Apache failed to startup while integrating php

Posted: Tue Nov 04, 2008 6:21 pm
by novinjaiswal
hi thanks for your kind reply.

iwas able to solve this issue by reintsallaing PHP5

Thanks
Novin