Upgraded from PHP4 to PHP5 and has broken secure image
Posted: Tue Jan 15, 2008 12:01 pm
I'm upgrading our code from PHP4 (4.4.8 ) to PHP5 (5.2.5) to enable the use of new functions exclusive to PHP5.
I followed the instructions in my hosting companies help pages for editing the .htaccess file (above the public_html directory) to convert all files to PHP5 by inserting the line
Everything on the site works under PHP5, except for a securely hosted image, which now shows as a broken image. On attempts to access the image's URL, I receive the standard Internal Server Error page. The URL for the image is:
https://web92.secure-secure.co.uk/minis ... relogo.jpg
(the image will display correctly if you try and access that URL now, because I've reverted back to PHP4 for the time being. But trust me that under PHP5, accessing it produces an Internal Server Error).
As soon as I remove the added 'PHP5 upgrade' line from htaccess, reverting the code base back to PHP version 4.4.8, the image displays correctly again.
I've experimented with hosting the image unsecurely instead, and the image will then display correctly in PHP5. So it seems I can have PHP4 and a secure image, and PHP5 with an unsecure image, but not PHP5 and a secure image, which is what I need (because the image is on a billing page, and the user doesn't want prompting about unsecure items on the page).
I've been in touch with my hosting company, who couldn't resolve the issue. I've read lots of PHP.net documentation, including the PHP4 to PHP5 migration issues, and searched the web, but I can't find a solution to this problem.
NB: The only other line in the htaccess file is
Removing this makes no difference to the result.
If anyone can help it will be greatly appreciated.
Regards,
Tim
I followed the instructions in my hosting companies help pages for editing the .htaccess file (above the public_html directory) to convert all files to PHP5 by inserting the line
Code: Select all
SetEnv DEFAULT_PHP_VERSION 5https://web92.secure-secure.co.uk/minis ... relogo.jpg
(the image will display correctly if you try and access that URL now, because I've reverted back to PHP4 for the time being. But trust me that under PHP5, accessing it produces an Internal Server Error).
As soon as I remove the added 'PHP5 upgrade' line from htaccess, reverting the code base back to PHP version 4.4.8, the image displays correctly again.
I've experimented with hosting the image unsecurely instead, and the image will then display correctly in PHP5. So it seems I can have PHP4 and a secure image, and PHP5 with an unsecure image, but not PHP5 and a secure image, which is what I need (because the image is on a billing page, and the user doesn't want prompting about unsecure items on the page).
I've been in touch with my hosting company, who couldn't resolve the issue. I've read lots of PHP.net documentation, including the PHP4 to PHP5 migration issues, and searched the web, but I can't find a solution to this problem.
NB: The only other line in the htaccess file is
Code: Select all
Options -IndexesIf anyone can help it will be greatly appreciated.
Regards,
Tim