LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-17-2001, 08:25 PM   #1
matt
Member
 
Registered: Jul 2001
Location: Chicago
Distribution: RH7.1 ; OSX
Posts: 62

Rep: Reputation: 15
Angry apache's OK, php's not


Howdy folks,

I did a server install of RedHat 7.1, with apache. I got apache working ok - the Test Page comes up and all.

However, it seems PHP installed with it. When I grep for php rpm's, I get:

php-imap-4.0.4pl1-9
php-4.0.4pl1-9
php-ldap-4.0.4pl1-9

If it helps, here's the path to:

/usr/lib/apache/libphp4.so

With this information, can you help me get php working with Apache? My phpinfo script turns up blank.

Thanks!

)Matt.
 
Old 11-18-2001, 03:21 PM   #2
kngharv
Member
 
Registered: Nov 2001
Location: China, USA
Distribution: SUN JDS/SUSE 9.1
Posts: 33

Rep: Reputation: 15
Same problem and issue of HAVE_PHP4 in http.conf

I have similiar problem using similiar setup:
PHP4 with Redhat 7.1

Apache itself ran fine and all, and that when I test a simple php file using command line, it works fine.

It seems that Apache is not recognizing the existance of php engine.

I looked at the httpd.conf file, all the php-related modules are surrounded one conditional:

<IfDefine HAVE_PHP4>
AddModule.....
</IfDefine>

Doe anyone knows how to set up that HAVE_PHP flag?

Thanks
 
Old 11-19-2001, 07:47 PM   #3
kngharv
Member
 
Registered: Nov 2001
Location: China, USA
Distribution: SUN JDS/SUSE 9.1
Posts: 33

Rep: Reputation: 15
HAVE_PHP flag

HAVE_PHP flag can be turned on by passing the arguement on the command line:

httpd start -DHAVE_PHP
 
Old 11-22-2001, 08:17 AM   #4
Sylhouette
Member
 
Registered: Oct 2001
Location: Beverwijk (Holland
Distribution: Red Hat 7.1
Posts: 132

Rep: Reputation: 15
I have the same problem

But when i do httpd start -DHAVE_PHP i het the folowing error messages


Syntax error on line 255 of /etc/httpd/conf/httpd.conf:
Cannot load /etc/httpd/modules/mod_php.so into server: /etc/httpd/modules/mod_php.so: cannot open shared object file: no such fie or directory.


This is ok because the file are not there but i have installed all the packages regarding php

So wich package on cd 1 or 2 give's me this file????
 
Old 11-22-2001, 01:10 PM   #5
amp2000
Member
 
Registered: Oct 2001
Location: Dublin, Ireland
Distribution: Mandrake 9.0 mostly!
Posts: 303

Rep: Reputation: 30
I dont even have:
####################################
<IfDefine HAVE_PHP4>
AddModule.....
</IfDefine>
####################################
the above line's anywhere in my httpd.conf.

I re-installed apache & php but still cant get it to work.

amp2000
 
Old 11-22-2001, 01:16 PM   #6
kngharv
Member
 
Registered: Nov 2001
Location: China, USA
Distribution: SUN JDS/SUSE 9.1
Posts: 33

Rep: Reputation: 15
I have figure it out :)

I got the same problem

when I pass the arguement using -DHAVE_PHP, the apache
is complainning that i don't have mod_PHP.so file.

*IF* you are using a new installation, and don't have any old php code, here is the way to solve the problem:

IGNORE IT

mod_php.so is actually refer to the older version of php engine (i think i'ts version 2.0). All the new linux distribution come with php version 4.0

instead of passing HAVE_PHP flag, try to pass the php4:

httpd start -DHAVE_PHP4

everything will work wonderfully.

Ohh, one more thing. Since I am new to the PHP business, at least on REDHAT distribution, apache is by default do *NOT* pass .html file to the php engine. If you have some .html file which contains some php code, you then need neither modify the httpd.conf file, or rename it to .phtml or .shtml file.

good luck

kngharv
 
Old 11-22-2001, 01:50 PM   #7
amp2000
Member
 
Registered: Oct 2001
Location: Dublin, Ireland
Distribution: Mandrake 9.0 mostly!
Posts: 303

Rep: Reputation: 30
I tried "httpd start -DHAVE_PHP4 " but it just threw me back at the prompt without any error messages.

Now when I try view index.php or index.phtml I am asked what I want to save it as WTF

amp2000
 
Old 11-22-2001, 04:45 PM   #8
Sylhouette
Member
 
Registered: Oct 2001
Location: Beverwijk (Holland
Distribution: Red Hat 7.1
Posts: 132

Rep: Reputation: 15
i've got it

Phffff

go to /etc/rc.d/init.d

And there type ./httpd start

And then yeah there it is my php working fine

Make a symlink to rc3.d and rc5.d and it will autostart ....

Succes
 
Old 11-23-2001, 07:16 PM   #9
matt
Member
 
Registered: Jul 2001
Location: Chicago
Distribution: RH7.1 ; OSX
Posts: 62

Original Poster
Rep: Reputation: 15
big dummy

Folks - I'm the guy that started the thread, and now it's time to finish it up with a big 'duh!'. I just forget to name my files with the php extention. So it's not index.html - it's index.php

Hurray!

)M.
 
Old 11-25-2001, 09:24 PM   #10
matt
Member
 
Registered: Jul 2001
Location: Chicago
Distribution: RH7.1 ; OSX
Posts: 62

Original Poster
Rep: Reputation: 15
one more thing

Another thing I noticed is that you need to put your php file within Apache's var/www/html folder (at least on Red Hat). You'll notice that your default Apache index page is in there ( /var/www/html/index.html). If you put a page called 'test.php' in this folder, such as your 'phpinfo();' script, your address bar in your web browser should be:

http://localhost/test.php

Hope this helps!

)matt.
 
  


Reply



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's global default page marsguy Linux - Software 2 05-31-2005 06:31 AM
Apache's CGI directory don_wombat Linux - Software 7 03-01-2005 12:14 PM
PHP's imagecreatefromPNG function Tomasfuego Linux - Software 0 06-20-2003 12:58 AM
Apache's Index XxAndyxX Linux - Software 2 03-16-2003 12:34 PM
changing apache's signature hardigunawan Linux - Software 1 05-31-2002 01:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:17 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