March 27, 2017, 10:33:29 AM
  Print  
Author Topic: Paid plans : PHP and Perl  (Read 9111 times)
XYLEM
Administrator
Experienced Member
*****
Posts: 7440

View Profile
« on: January 28, 2006, 07:09:25 PM »

Can I use custom CGI (Common Gateway Interface) scripts?
Yes, you are allowed to use .cgi and .pl files in your account.


Where I can use my Perl and PHP scripts?
Perl scripts do not require special /cgi-bin/ directory. You can place the Perl and the PHP scripts in any directory you wish.

The path to the Perl is /usr/bin/perl
The path for the Sendmail is: /usr/sbin/sendmail

The required permissions are as follows:
PHP scripts - chmod 755 filename.php
Perl scripts - chmod 755 filemane.cgi


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 subdomain, a domain or other folders there.
Logged

XYLEM
Administrator
Experienced Member
*****
Posts: 7440

View Profile
« Reply #1 on: January 28, 2006, 07:11:54 PM »

My script is giving me this error 'Internal Server error'. Why is that?
PHP and Perl scripts require permissions so the server can execute them correctly. If you are getting this error than it means that you have not set the correct premissions.
The required permissions are as follows:
PHP scripts - chmod 755 filename.php
Perl scripts - chmod 755 filemane.cgi
Changing premissions can be done via FTP and SSH or inside the FileManager
Logged

XYLEM
Administrator
Experienced Member
*****
Posts: 7440

View Profile
« Reply #2 on: January 28, 2006, 07:12:29 PM »

Formmail script is not working - it does not deliver the email to me. What's the problem?
You are having troubles sending the emails using Formmail script, because of the following reasons:

1. You have entered an email which is not hosted on our servers. We require the FROM email to be hosted on our servers. Only if the FROM email is hosted on our servers you will be able to send email successfully.

2. You are using wrong header information. You must always provide the text From:, the name of the sender and email address. Without even one of these 3 parameters the formmail script will not work properly and will not deliver the email to your mailbox. You can find out more information here: http://www.php.net/manual/en/function.mail.php

Here's an example of well working formmail script:

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

if(mail($to,$subject,$body,$from)) echo 'MAIL - OK';
else echo 'MAIL FAILED';
?>
Logged

XYLEM
Administrator
Experienced Member
*****
Posts: 7440

View Profile
« Reply #3 on: January 28, 2006, 07:13:21 PM »

I'm getting '500 Internal Server Error'. Where's the problem?
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 trought the File Manager inside the Control panel or trought FTP. Once you set them to 755 they will be working fine.

To change them trought FTP select the file and do this commands: 'chmod 755'. Or you can use the File Manager for the purpose.

Please note that setting the folders to 755 will not set the files to 755. They will remain 644, until you select all PHP and Perl files and set them to 755.
Logged

XYLEM
Administrator
Experienced Member
*****
Posts: 7440

View Profile
« Reply #4 on: January 28, 2006, 07:13:58 PM »

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 are giving this error ONLY when permissions are wrong.
Logged

  Print  
 
Jump to: