Jump to content

Recommended Posts

Hello there,

 

I installed a photo sharing script on my site, but for some reason it keeps asking me to download a file whenever I visit the site.  I was told that there was an issue with the PHP installation on my server so I asked my host to reinstall and they did, but I"m still having the same problem.

 

"AddHandler php5-script .php" is in a .htaccess file and it seems to be causing the problem. 

 

Any ideas how I could fix this problem?

 

Thanks,

Jose

Link to comment
https://forums.phpfreaks.com/topic/157555-addhandler-php5-script-php-issue/
Share on other sites

Backup all .htaccess localy and delete them on the web server.

 

Put a small hello world php script to test like that :

 

/helloworld.php

<?php
echo "<b>Hello World!</b>";
?>

 

If it work, the problem coming from your scripts, if it doesn't call your hosting and ask them to fix it until it does. It's their job to provide you a hosting with a working php you shouldn't have to play with htaccess to make it work, php scripts file should be configure in main apache config.

 

If the problem coming from your scripts, post the complete .htaccess (including .htaccess on root directory that get called too)

 

AddHandler php5-script .php
From my php install.txt :

16. Is it possible to use Apache content negotiation (MultiViews

  option) with PHP?

 

  If links to PHP files include extension, everything works perfect. This

  FAQ is only for the case when links to PHP files don't include

  extension and you want to use content negotiation to choose PHP files

  from URL with no extension. In this case, replace the line AddType

  application/x-httpd-php .php with:

# PHP 4

AddHandler php-script php

AddType text/html php

 

# PHP 5

AddHandler php5-script php

AddType text/html php

 

  This solution doesn't work for Apache 1 as PHP module doesn't catch

  php-script.

 

I usually see that in the apache config (not in the .htaccess) :

AddType application/x-httpd-php .php

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.