Hello, I was wondering if somebody knows how to make the php scripts work with other file extensions besides .php. I am hoping to make it work with files with no extensions, and it does not work because it doesnt have the .php extension. How to I make php scripts work with this? Thanks.

    You can possible get away with php3 php4 php5 or phtml but unless I am completely insane I do not believe there is any computer language, script that would treat a text string with no dot something as anything other than a plain old text string unless it is a reserved word in that language or script, so I doubt you will ever find a means of running php with no extension.

      It's a matter of telling your server which file extensions you're using for PHP. Check whichever section of the manual's [man]install[/man] pages is relevant for more details. If you want the server to treat .wibble files as PHP, you tell the server that and it will. The W3C has quite a few suggestions about robust URL design, including leaving out file extensions entirely.

      In short: it's your server's job to decide what files to read and what scripts to run when a particular URL is requested. Consult your server's documentation for information about how to use it.

        Ok cool thanks. I'll check it out. And in response to Houdini, it is possible to have pages with no file extension. Many major websites, like google and yahoo use them. Here is one of mine: http://www.czcheats.107thr.com/ . Thanks for the replies!

          After reading over the installation area of the manual, there is still no area where it tells you which files control the extensions to use with php. Could you tell me which file to edit. Thanks.

            If you want to do that then try the httpd.conf in the apache/conf on about line 237 and look for

            <IfModule dir_module>
            DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
            </IfModule>

              Aww...but I have IIS 5.1... Any other suggestions? Thanks.

                Sorry I quit IIS years ago and went with apache all I know is that in the PHP folder there should be an install for your IIS, but you might have to go over your IIS docs to see how to set the server up.

                  oh yes, thank you for reminding me. i need to remove my file extentions once i get everything running good enough.

                  you can do it thru apache and you can also run .inc thru PHP

                    jspechts wrote:

                    After reading over the installation area of the manual, there is still no area where it tells you which files control the extensions to use with php.

                    Yes it does, otherwise no-one would be able to set PHP up on IIS in the first place. I'm certain there's no page in the IIS manual that says "How to set up PHP on IIS", but there wouldn't need to be, since there would be general documentation on how to register any given file extension with any given file handler, and the administrator could figure things out from that. For PHP-specific stuff, there's a section in the PHP manual on how to set up IIS for PHP. That page says:

                    Click on the 'Configuration' button, and choose the Application Mappings tab. Click Add and set the Executable path to the appropriate CGI file. An example PHP 5 value is: C:\php\php-cgi.exe
                    Supply .php as the extension.
                    Leave 'Method exclusions' blank, and check the 'Script engine' checkbox. Now, click OK a few times.

                    Well, it says a lot more than that, but I'm not going to copy out the whole page; that's the relevant bit. Feel free to "supply .wibble as the extension", where .wibble is whatever takes your fancy.

                      Thanks a lot sir, I guess I need to read up more...but this is really useful. I have my own extensions now, but it still won't support extention-less files. If you ask why I do this, it is because of security purposes that I have read an article about. Is there a way where you can add no extension? Thanks!

                        To give the impression of using extension-less files you need to use apache's mod_rewrite module. IIS doesn't have any alternative equivelent to mod_rewrite available.

                          Write a Reply...