LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-30-2011, 08:15 AM   #1
bellhuang
LQ Newbie
 
Registered: Feb 2010
Location: China
Posts: 18

Rep: Reputation: 0
Unhappy Why doesn't the apache parse PHP


Dear all,
I have installed httpd-2.2.17 on my fedora 13 as following:
./configure --prefix=/usr/local/apache --enable-so
make && make install
php-5.3.6 with --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs
make && make install

cp php.ini-production /usr/local/lib/php.ini
add the following into httpd.conf
LoadModule php5_module modules/libphp5.so
<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
</IfModule>
When type "apachectl start" in command line, the browse can display the fedora test page with URL:http://localhost/, but it can not parse phpinfo() in htdocs directory.
When type "/usr/locale/apache/bin/apachectl start" in command line, error occured as below:
httpd: Syntax error on line 53 of /usr/local/apache/conf/httpd.conf; cannot load /usr/local/apache/htdocs/modules/libphp5.so into server: /usr/local/apache/htdocs/modules/libphp5.so:cannot open shared object file:No such file or directory.
It seemed the libphp5.so hasn't been loaded, right?
Could anyone help me? THANKS.

Last edited by bellhuang; 05-30-2011 at 06:54 PM.
 
Old 05-30-2011, 08:28 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,221
Blog Entries: 1

Rep: Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075
Hi,

Check the ServerRoot. It should be
ServerRoot "/usr/local/apache"

Regards
 
Old 05-30-2011, 06:57 PM   #3
bellhuang
LQ Newbie
 
Registered: Feb 2010
Location: China
Posts: 18

Original Poster
Rep: Reputation: 0
Dear bathory,
The httpd.conf was modified as you suggested, but it still does not work.
 
Old 05-30-2011, 07:31 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,305

Rep: Reputation: 2692Reputation: 2692Reputation: 2692Reputation: 2692Reputation: 2692Reputation: 2692Reputation: 2692Reputation: 2692Reputation: 2692Reputation: 2692Reputation: 2692
Quote:
It seemed the libphp5.so hasn't been loaded, right?
I would bet on that being at least part of the problem. Have you checked to see if that file is actually present? I haven't installed Apache from the command line for quite some time but if you have further problems I am sure someone more knowledgeable will have suggestions.
 
Old 05-30-2011, 08:08 PM   #5
bellhuang
LQ Newbie
 
Registered: Feb 2010
Location: China
Posts: 18

Original Poster
Rep: Reputation: 0
it solved!

I have changed libphp5.so from ...apache/modules to httpd/modules and modified ServerName as 127.0.0.1
Now, it can parse the phpinfo()

Thank bathory and yancek!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache 2.2 doesn't process .php... again imi@tux Linux - Server 2 12-16-2006 07:54 AM
Apache doesn't execute PHP files? dbc001 Linux - Software 2 01-28-2006 02:29 PM
apache won't parse php argghgh dtra Linux - Software 3 02-17-2005 05:28 PM
Apache doesn't display php webpage rover SUSE / openSUSE 2 11-08-2004 10:07 AM
FreeBSD Apache 1.3.29 wont parse PHP! pnh73 *BSD 6 01-19-2004 10:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration