|
How to use php5
- By default it is accessible using .php5 extension for php files. Just have the php script named something.php5 and viola it will be processed by php5.
- To use php5 for all *.php files as default in your entire account, you need to edit ~/public_html/.htaccess file and add this directive:
# Use PHP5 as default
AddHandler application/x-httpd-php5 .php
This will make the server process all files named .php by php5.
After this change, no files under public_html will be processed by old php4. Please note that preceding marker comment "# Use PHP5 as default" is mandatory.
- If you want to use both php4 and php5, you can create a subfolder in public_html say "test5" and add the above mentioned directive in .htaccess there (i.e. public_html/test5/.htaccess). This way php5 will be used only under that "test5" folder and the folder tree under it, and rest of your account will continue to use php4.
- register_globals is off by default and will remain off in php5. It is said that php6 will not have register_globals, so it is a good time to fix your scripts not to depend on it.
For Advanced Users
- To make changes to php configuration, you will need to install php.ini in public_html folder (or the DOCUMENT_ROOT of subdomain/addon domain i.e public_html/subdomain). We have placed a typical default php.ini file for php5 here: http://69.73.181.191/php5.txt
Please rename it to php.ini
NOTE: In the current php5 implementation, php5 will pick php.ini in the following precedence:
local folder (higher precedence) > public_html (or DOCUMENT_ROOT) > default global php.ini (at server level)
- For shared hosting clients using shared SSL certificate, you will need to change permission of your public_html folder to 755. You can do that from cpanel file manager.
The default permission is 750 with ownership of userid:nobody.
While accessing php5 over shared ssl, php5 will pick php.ini from the local folder where php5 file is being executed.
|