Apache failed to startup while integrating php

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
novinjaiswal
Forum Newbie
Posts: 5
Joined: Sun Nov 02, 2008 7:28 pm

Apache failed to startup while integrating php

Post 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
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Apache failed to startup while integrating php

Post 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
There are 10 types of people in this world, those who understand binary and those who don't
novinjaiswal
Forum Newbie
Posts: 5
Joined: Sun Nov 02, 2008 7:28 pm

Re: Apache failed to startup while integrating php

Post 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
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Apache failed to startup while integrating php

Post 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 ;)
There are 10 types of people in this world, those who understand binary and those who don't
novinjaiswal
Forum Newbie
Posts: 5
Joined: Sun Nov 02, 2008 7:28 pm

Re: Apache failed to startup while integrating php

Post 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
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Apache failed to startup while integrating php

Post by VladSun »

It's the PHP CLI (Command Line Interface), not the PHP module used by Apache.
There are 10 types of people in this world, those who understand binary and those who don't
novinjaiswal
Forum Newbie
Posts: 5
Joined: Sun Nov 02, 2008 7:28 pm

Re: Apache failed to startup while integrating php

Post 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
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Apache failed to startup while integrating php

Post 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?
There are 10 types of people in this world, those who understand binary and those who don't
novinjaiswal
Forum Newbie
Posts: 5
Joined: Sun Nov 02, 2008 7:28 pm

Re: Apache failed to startup while integrating php

Post by novinjaiswal »

hi thanks for your kind reply.

iwas able to solve this issue by reintsallaing PHP5

Thanks
Novin
Post Reply