Click to See Complete Forum and Search --> : giving the php parser a kick ?
Hello group,
Can you help me get over what must bre the final hurdle.
I have installed mysql,apache and php under suse7.1 with no apparent problems but when it come to running the script i called php.php which includes the code snippet <? phpinfo(); ?> this is not executed but displayed to the browser as text.
How do i give the php parser a kick and get i to display the page we all now and love.
Do any changes need to be made to php.ini-dist or the httpd.conf file besides the uncommenting of the two lines in httpd.conf relating to php4 file extensions.
Please any insights and suggestions
Paul
vincente
07-21-2001, 10:10 AM
Did you edit the right httpd.conf?
Did you make sure the .php extention is in use, and not only the php3?
Did you give your apache a restart after editing the config?
Hello Vincent,
thanks very much for your reply.can i just say on behalf of the group that your input to this site is invaluable and very much appreciated.
can i ask you if you would provide snippets of how some some of the lines should look or tests that i could carry out as i think this is probably a common problem for newbies.
cheers
paul
vincente
07-22-2001, 01:06 AM
/me takes a bow
thank you, thank you.
Just doing my bit. (and having enormous fun showing off my knowledge because I'm so modest:) )
The lines in the httpd.conf should look exactly like the manual says:
-- quote --
17. Edit your httpd.conf or srm.conf file and add:
For PHP 3:
AddType application/x-httpd-php3 .php3
For PHP 4:
AddType application/x-httpd-php .php
You can choose any extension you wish here. .php is simply the one
we suggest. You can even include .html .
18. Use your normal procedure for starting the Apache server. (You must
stop and restart the server, not just cause the server to reload by
use a HUP or USR1 signal.)
-- end quote --
Note that you can add as many extentions as you like on those lines.
If you want to use PHP4 to parse *.php3 files:
AddType application/x-httpd-php .php .php3
And maybe even html files (I would advice against this)
AddType application/x-httpd-php .php .php3 .htm .html
Common mistakes:
- You uncommented/added the wrong line, making the server only parse *.php3 and you only use *.php
- you edited the wrong httpd.conf
Many servers have multiple httpd.conf files, one in the install directory, one that's actually in use, an exampkle file, etc..
- You didn't restart apache.
- You restarted apache by sending a HUP instead stopping and restarting
Less common error:
- You edited the httpd.conf while apache gets this info from srm.conf (unusual because apache defaults to not use the srm.conf)
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.