iamjose Posted May 10, 2009 Share Posted May 10, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/157555-addhandler-php5-script-php-issue/ Share on other sites More sharing options...
gffg4574fghsDSGDGKJYM Posted May 10, 2009 Share Posted May 10, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/157555-addhandler-php5-script-php-issue/#findComment-830943 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.