LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   apache's OK, php's not (https://www.linuxquestions.org/questions/linux-software-2/apaches-ok-phps-not-8861/)

matt 11-17-2001 08:25 PM

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.

kngharv 11-18-2001 03:21 PM

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

kngharv 11-19-2001 07:47 PM

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

httpd start -DHAVE_PHP

Sylhouette 11-22-2001 08:17 AM

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????

amp2000 11-22-2001 01:10 PM

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

kngharv 11-22-2001 01:16 PM

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

amp2000 11-22-2001 01:50 PM

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

Sylhouette 11-22-2001 04:45 PM

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

matt 11-23-2001 07:16 PM

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.

matt 11-25-2001 09:24 PM

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.


All times are GMT -5. The time now is 06:15 AM.