Hi, How May I Help You?
Click here to talk to one of
our sales representatives.
AVAILABLE BETWEEN:
09.00 AM - 02.00 AM (GMT/UK)
04.00 AM - 09.00 PM (EST/US)

- WHAT'S INCLUDED -
Affordable Web Hosting Packages
- Up to 40 GB of Disk Space
- Up to 500 GB of Transfer/mo.
- Free Domain Name For Life
- Host Unlimited Domain Names
- Unlimited POP3 E-mail Accounts
- MS FrontPage Extensions
- Free Site Builder with Templates
- PHP, Perl/CGI, Python & MySQL
- One-Click Website Software
Installer (forums, CMS, blogs ++) - Free Setup - No Hidden Fees
[click here for a full list of features]
Knowledge Base - Frequently Asked Questions
These articles have been written to help you quickly find an answer to some of the most frequently asked questions regarding our services. You can browse the Questions & Answers by clicking on the topics below. If you can't find the answer to your question in our FAQ, please don't hesitate to contact us!
Back | PHP/Perl/Python Settings & Errors
Articles In This Category:
- Is it possible to use PHP scripts within an .html file?
- I've set 755 permissions to my script, but it is still giving an Internal Server Error.
- I can't get PHP's mail() function to work. What to do?
- How can I use custom PHP and CGI (Perl) scripts?
- What is the path (document root) to my files?
- I'm getting a '500 Internal Server Error'. Where's the problem?
- How to run Python scripts?
- How do I enable register_globals for my PHP scripts?
Is it possible to use PHP scripts within an .html file?
Yes! To be able to use PHP code within .html files, simply add the following line to your .htaccess file:
AddHandler cgi-script .html
Or for an .htm file, the line will be the following:
AddHandler cgi-script .htm
If you don't currently have an .htaccess file in your account, just create a new file named .htaccess (note the dot [.], with no prefix) with the line above as the only content. Then upload it to the "yourdomain.com" directory on the server.
I've set 755 permissions to my script, but it is still giving an Internal Server Error.
For Perl/CGI scripts the solution is to add '-w' after the Perl path in your script. It will look like this:
#!/usr/bin/perl -w
This will enable 'warnings' in Perl. Some Perl scripts do not run without this option.
For PHP scripts:
This is because the PHP file has wrong permissions. You probably set 755 to the folder where the PHP files are located, but you did not set 755 to the files. You must select all PHP files and change their permissions, not just the permissions of the folders.
PHP files give this error ONLY when permissions are wrong.
I can't get PHP's mail() function to work. What to do?
You can be having trouble sending e-mail through your PHP script, because of the following reasons:
- You have entered an e-mail address which is not hosted on our servers. We require that either the 'FROM:' e-mail address or the 'TO:' e-mail address is hosted on our servers. Only if one of them is hosted on our servers, you will be able to send e-mail successfully. This is a measure taken to prevent unsolicited e-mails from being sent.
- You are using wrong header information. You must always provide the string 'From:', the name of the sender and an e-mail address. Without one of these three parameters, the formmail script will not work properly and will not deliver e-mail to your mailbox. You can find out more information here:
http://www.php.net/manual/en/function.mail.php
Here are two simple examples of well working form mail scripts:
Example 1:
<?
$from = "From: yourname <yourname@yourdomain.com>";
$to = "recipient";
$subject = "Hi!";
$body = "Mail TEST";
if (mail($to,$subject,$body,$from)) echo "MAIL - OK";
else echo "MAIL FAILED";
?>
Example 2:
<?
$from = "From: sender";
$to = "yourname <yourname@yourdomain.com>";
$subject = "Hi!";
$body = "TEST";
if(mail($to,$subject,$body,$from)) echo "MAIL - OK";
else echo "MAIL FAILED";
?>
How can I use custom PHP and CGI (Perl) scripts?
To use a custom script, just upload the .php, .php5, .cgi or .pl file(s) to your account. The Perl scripts do not require a special /cgi-bin/ directory as some server configurations require. You can place your Perl and PHP scripts in any directory you wish.
The path to the Perl directory is: /usr/bin/perl
The path to the Sendmail directory is: /usr/sbin/sendmail
The required permissions are as follows:
PHP scripts - chmod 755 filename.php
Perl scripts - chmod 755 filemane.cgi
Note: Currently, support for both PHP 4.4 and PHP 5 is available on our servers simultaneously. If you want to use PHP version 5, you need to create the PHP files using the extension ".php5".
What is the path (document root) to my files?
The path is: /home/www/yourdomain
It depends on where you have uploaded your files. You can see the /www directory in your account and you can create a domain, a subdomain or other folders there.
I'm getting a '500 Internal Server Error'. Where's the problem?
You are getting this error because all PHP and Perl files must have permission set to 755. You can change the permissions of the files through the File Manager inside the Control panel or through FTP. Once you set file permissions to 755 PHP/Perl scripts will be working fine.
To change file permissions through FTP select the file and use the command: "chmod 755". Or you can use the File Manager for the purpose.
Please note that setting the folders permissions to 755 may not automatically set its files and subdirectories permissions to 755. You may have to select all PHP and Perl files and set their permissions to 755.
How to run Python scripts?
Python on our servers runs as an CGI executable. To use Python on our servers, do one of the following:
-
Add #!/usr/bin/python to the very first line of the script, and save the file with the extension '.py'.
Then create a .htaccess file (or edit your existing one) and add the following line: AddHandler cgi-script .py - Add #!/usr/bin/python to the very first line of the script, and save the file with the extension '.cgi'.
The permissions of the file(s) must be set to 755.
How do I enable register_globals for my PHP scripts?
PHP register_globals is disabled by default for security reasons. If your scripts require register_globals to be on, please follow these steps:
- Log into your Control Panel and open the File Manager. Then navigate to the /sys/phpX/ folder (replace X with your PHP version, e.g. "php5")
- Find the file named php.ini and click on the Edit icon in the Options column. Click on Open with plain text editor.
- Locate the line saying "register_globals = Off" and replace it with "register_globals = On", then click on Save to store the changes. Your scripts should now function properly.


