Forum Moderators: phranque
I'm moving a client from an old server (setup by another admin who's not available to help) to a new server and am having a problem. One particular section of the site uses a PHP file without an extension, named simply 'send', as follows:
www.example.com/download/send/file_path/filename.exe
On the server, the send file is just in the /download directory and is supposed to take the request, log it to a file, then provide the file in question from the /download/files/ directory for download. I can provide the PHP code if requested, it's short and simple. Problem is, I can't get the new server to do it, I just get a 404. Adding to the problem is that the old server is setup sort of oddly, and I can't for the life of me find the httpd.conf file for this site. I believe the old admin named it something different and he setup the structure of the old server strangely, so I have no idea where it is. However, there is another site on the old server that uses PHP files without extensions, and that site does have an httpd.conf file and he's doing the following to provide for it:
<Location /apply>
ForceType application/x-httpd-php
</Location>
where apply is the PHP file. I've tried the "ForceType application/x-httpd-php" in the Directory section of the httpd.conf file on the new server, with no luck.
Any help would be appreciated. Thanks.
www.domain.com/confirm
where confirm is a php script in the root directory of www.domain.com. There are about 15 of these extensionless files. Now, the old server's httpd.conf file has the following:
<Location /confirm>
ForceType application/x-httpd-php
</Location>
So, I put this in the httpd.conf file for the appropriate site, and no luck. I get a "do you want to save this file?" dialog box, calling it an unknown file type. I tried changing it to:
<Files confirm>
ForceType application/x-httpd-php
</Files>
And I tried this, as suggested here: [us4.php.net...]
<Files ~ "^[^\.]+$">
ForceType application/x-httpd-php
</Files>
Which gave me the same result. I'm kinda at a loss, as I'm not really an apache/linux expert, just sort of moderately-experienced with them. Anyone have any ideas?
Thanks in advance.
<IfDefine vwh_php4_module>
<IfModule sapi_apache2.c>
php_admin_flag safe_mode on
AddType application/x-httpd-php .php .phtml .php4 .php3
</IfModule>
</IfDefine>
And this is in the included one:
<IfModule mod_php4.c>
# Don't allow mod_php
php_admin_flag engine off
</IfModule>
<IfModule sapi_apache2.c>
php_admin_flag engine off
</IfModule>
Action php-script /interpreters/php-script
AddHandler php-script .php .php4 .php3 .phtml
Those are the sections that have to do with PHP. Am I missing something?
Thanks.
www.domain.com/confirm.php
it runs just fine. But, if I go to:
www.domain.com/confirm
which is the original filename, I immediately get the "do you want to save this file?" dialog box with choices to save as or cancel, so the browser doesn't return anything, it's like the server still doesn't know it's a php file and is just trying to present the file for download or something.
AddType application/x-httpd-php .php .phtml .php4 .php3
right below the rest of your other config info, so it looks like this.
<IfModule mod_php4.c>
# Don't allow mod_php
php_admin_flag engine off
</IfModule>
<IfModule sapi_apache2.c>
php_admin_flag engine off
</IfModule>
Action php-script /interpreters/php-script
AddHandler php-script .php .php4 .php3 .phtml
AddType application/x-httpd-php .php .phtml .php4 .php3
I'm not sure how you are setup there, PHP as module or CGI, etc. But I can tell you that your MIME-type is not being recognized. Don't forget to restart Apache after making the change.
[webmasterworld.com...]
It seems something is botching the handling of the MIME-type and I can't quite visualize what it may be. You said you already checked MultiViews out as mentioned in the earlier post, correct?