I have a website (based on ZEND) and hosted on server 1and1.
Server 1and1 uses PHP versions 5.2.17 and 5.4.5. I need to use PHP version 5.4.5 for only a few files. This is because some of my other files show errors if I use PHP 5.4.5, but they run fine using PHP 5.2.17.
In my .htaccess file, the line below was written earlier to use PHP 5.2.17
AddType x-mapp-php5 .php
To use PHP 5.4.5, I have to use the line below (instructions for using this code will be found on page 1 and 1 faq)
AddHandler x-mapp-php6 .php
FAQ:
Can I use PHP 5.4.5 only for these specific files?
I tried using the line below in .htaccess, but it does not work:
AddType x-mapp-php5 .php AddHandler x-mapp-php6 FilenameController.php
EDIT
I tried to change the code 5.2. I use PEAR packages to create an Excel worksheet that works fine with PHP 5.2.17, but displaying the error below in PHP 5.4.5
Fatal error: Cannot override _PEAR_call_destructors ()
Adding
This is a change in the .htaccess file
AddType x-mapp-php5 .php AddHandler x-mapp-php6 .php6 SetEnv APPLICATION_ENV development Options -MultiViews <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^FilenameController\.php$ FilenameController.php6 [L] RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] </IfModule>
It generates 404 error "Page not found" if I change the file name FilenameController.php to FilenameController.php6 and when I try to visit the page with its creation.
php .htaccess
Debashis
source share