It is currently Fri Oct 07, 2022 9:19 am

All times are UTC

Forum rules

Please click here to view the forum rules

Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Q&A: PHP/Perl settings and errors
PostPosted: Mon Feb 21, 2005 4:07 am 
Site Admin
Site Admin

Joined: Fri Feb 11, 2005 7:43 am
Posts: 1818
Location: 100WebSpace's Headquarters
1 ) I'm getting '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 will be working fine.

To change file permissions through FTP select the file and use the commands: "chmod 755". Or you can use the File Manager for the purpose.

Please note that setting the folders permissions to 755 does not automatically set file permissions to 755. File permissions will remain 644, until you select all PHP and Perl files and set their permissions to 755.

2 ) Can I use custom PHP and CGI (Perl) scripts?
Yes, you are allowed to use .cgi and .pl files in your account.
The Perl scripts do not require a special /cgi-bin/ directory. You can place Perl and PHP scripts into 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

3 ) What is the path to my files?
The path to the files is: /home/www/SUBDOMAIN

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.

4 ) Formmail script is not working - it does not deliver the email to me. What's the problem?
You can be having trouble sending e-mail using Formmail script, because of the following reasons:

1. You are using the Free hosting service - free hosting users are not allowed to send emails.

2. You have entered an e-mail address which is not hosted on our servers. We require the one of either the 'FROM:' e-mail address or the 'TO:' e-mail address to be hosted on our servers. Only if one of them is hosted on our servers, you will be able to send e-mail successfully.

3. You are using wrong header information. You must always provide the text 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:

Here are examples of well working formmail scripts:

First Example:

$from = "From: yourname ";
$to = "receiver";
$subject = "Hi! ";
$body = "TEST";

if(mail($to,$subject,$body,$from)) echo "MAIL - OK";
else echo "MAIL FAILED";

Second Example:

$from = "From: sender";
$to = "yourname ";
$subject = "Hi! ";
$body = "TEST";

if(mail($to,$subject,$body,$from)) echo "MAIL - OK";
else echo "MAIL FAILED";

5 ) I've set 755 to my Perl/CGI/PHP script, but it is still giving Internal Server Error.
For Perl and CGI scripts the solution is:

to add '-w' after the Perl path in your Perl 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 the folders.

PHP files give this error ONLY when permissions are wrong.

6 ) I want to use PHP within an .html file. What should I do in order to make it work?
Add this line into the .htaccess file:

AddHandler cgi-script .html

Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ]  Moderators: KJ, fhmagic, Support Team, Moderators

All times are UTC

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
100WebSpace © 2011