Knowledgebase : Technical Issues > Scripts

While we highly recommend against running older versions of PHP under any circumstances, in that rare case when you want to run legacy scripts that require old PHP version (5.3 being the oldest at the moment), you can do the following:

  • Find and open (or create if it doesn't exist) file named .htaccess in document root folder. It usually resides in ~/public_html directory, but may be located in a sub-directory, in which case you'll be running legacy PHP version for that subdirectory only.
  • Insert the following code somewhere at the top of .htaccess in order to select PHP 5.3:
    <FilesMatch \.(phtml|php[543]?)$>
    SetHandler application/x-httpd-php53
    </FilesMatch>
  • Save the file and test the code. You might want to create a test PHP script with contents "<? phpinfo() ?>" to see information about current interpreter.

 

Recently, we've tightened up PHP security settings. This article discusses them in details and applies only to PHP scripts.

Specifically, we now disallow the following PHP functions:

dl,shell_exec,exec,system,passthru,popen,proc_open,proc_nice,proc_get_status,proc_close,proc_terminate,posix_mkfifo,set_time_limit,ini_restore,show_source,highlight_file.

In case your scripts need to execute some or all of them or you are getting such kind of errors: you are permitted to override the restrictions and specify list of disallowed functions manually, or disable the restriction at all.

Warning: exec() has been disabled for security reasons in /home/username/public_html/script.php on line 5

Here is how you do it:
* Go to domain's document root directory. This is usually the place you've uploaded your files to. In our case, it's /home/username/public_html.
* Find the file named php.ini. Open it up for editing.
* Look for disabled_functions line. Edit it as needed (recommended) or comment the whole line out (only as last resort), placing comment sign ";" before it.
* Save the file and test your PHP script.

One of the more common problems that is the result of a whitespace at the end of a file.

The error looks like this:

Warning: Cannot modify header information – headers already sent by (output started at /home/user/public_html/config.php:40) in /home/user/public_html/index.php on line 6

In order to sort it, remove any extra lines from the file specified in the particular error message.

If you need assistance with it, simply reach out to us through support!

 

 

 

 

The reason why you're getting a "406 Not Acceptable" error (either in browser or in error log) is simple: the HTTP request was blocked by our security system.

It doesn't necessarily mean the request was malicious and targeted to exploit system or application vulnerabilities. It could possibly be a false positive, in which case you should just open a support ticket with us and we'll provide more details about the source, reason, and outcome of the supposed-to-be attack.

If you want to raise your file upload limit from the default value of 2MB to a larger size, try the following. We'll be using 64 MB as an example.

Edit the php.ini file in domain's docroot (usually "public_html" directory) and add these lines:

upload_max_filesize = 64M
post_max_size = 64M

Save the file and you're done!