Click to See Complete Forum and Search --> : PHP configuration


JSPro
January 29th, 2005, 03:48 PM
i have a few questions about PHP configuration. Hopefully, you will answer them all for me.

1- I configured apache 2 to work with php and mysql. There is no problem. When i type 127.0.0.1\phpinfo.php, everything works.

what do i need to do to make it work if i type 127.0.0.1\phpinfo in IE's address (this time is no .php extension).?

2- let's say i write a php script and save it in desktop> when i click on it, i want IE to open it and execute it without going to command line and type php example.php.

thank you

khp
January 29th, 2005, 08:21 PM
what do i need to do to make it work if i type 127.0.0.1\phpinfo in IE's address (this time is no .php extension).?


Somewhere in your httpd.conf file you should have a line like


DocumentRoot "/var/www/html"

Which tells apache that the document root is stored in the directory "/var/www/html".
Somewhere else you should have a line like

<Directory "/var/www/html">

This marks the beginning of the configuration of how apache will handle files in this directory.
If you put in a line like

SetHandler application/x-httpd-php

immedieatly after the line <Directory "/var/www/html">.
Apache should then use php to interpret all files in the directory, depending on your php configuration you might need to use another handler than application/x-httpd-php. And of course this might have adverse effects on other pages hosted by the webserver.
There is a multitude of other ways to achive something simmilar, using mod-rewrite or a directory handler or a cgi handler or whatever. All of which causes more trouble than they are worth, using .php for php scripts much more preferable.


2- let's say i write a php script and save it in desktop> when i click on it, i want IE to open it and execute it without going to command line and type php example.php.


IE cannot execute PHP files.