member11 Posted January 29, 2005 Share Posted January 29, 2005 --------------------------------------------------------------------------------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 in IE, 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 Link to comment Share on other sites More sharing options...
XtremeMaC Posted January 30, 2005 Share Posted January 30, 2005 1. add this to httpd.conf<Files ~ "^[^\.]+$"> ForceType application/x-httpd-php</Files>orEdit httpd.conf to reflect "AddType application/x-httpd-php"Edit httpd.conf to reflect "ServerSignature Off"Edit php.ini file to reflect "expose_php = off"2. press [shift] and right click to any of the php files, choose [open with] and then select IE.oropen a foldergo to tools go to folder optionsgo to file typestype PHP in thereclick on advancedclick on new type the action name like "open in IE"beneath that click on browse and browse to IEand click okafter that u can set it to default if u want it to be the default action.. Link to comment Share on other sites More sharing options...
member11 Posted January 30, 2005 Author Share Posted January 30, 2005 thank you. I'll try it out today and let you know how it works Link to comment Share on other sites More sharing options...
member11 Posted January 31, 2005 Author Share Posted January 31, 2005 Edit httpd.conf to reflect "AddType application/x-httpd-php"Edit httpd.conf to reflect "ServerSignature Off"Edit php.ini file to reflect "expose_php = off" your solution didn't work Link to comment Share on other sites More sharing options...
XtremeMaC Posted January 31, 2005 Share Posted January 31, 2005 how about the other one? Link to comment Share on other sites More sharing options...
Shotgun Posted January 31, 2005 Share Posted January 31, 2005 a) A quick fix would be to rename './data/index.php' into './data' and then use a ForceType directype to effectively call http://myserver.com/dataHint:<Location "/data">ForceType application/x-httpd-php</Location>B) Alternatively you may also try SetHandler or AddHandler (this depends on your setup) and use a PHP-driven front controller.Hint:Alias /php-bin /usr/local/www/.../php-bin<Location /php-bin>AllowOverride NoneOptions Includes</Location>w/ <Location "/data">Action php-script /php-bin/handler.phpSetHandler php-scriptDirectoryIndex ./test.foo</Location>or<Location "/data">Action php-script /php-bin/handler.phpAddHandler php-script .fooDirectoryIndex ./test.foo</Location>Have a look at:<http://httpd.apache.org/docs-2.0/mod/core.html#forcetype><http://httpd.apache.org/docs-2.0/mod/mod_mime.html><http://httpd.apache.org/docs-2.0/mod/core.html#sethandler><http://www.onlamp.com/lpt/a/4987> Link to comment Share on other sites More sharing options...
zprog Posted February 3, 2005 Share Posted February 3, 2005 Yep, that should work. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now