Scripts & Programming

Running Scripts


This section covers CGI scripts, program paths, viewing installed Perl modules, understanding permissions, PHP scripts, and accessing phpMyAdmin.


CGI Scripts

All CGI scripts must be placed in your cgi-bin directory.  The cgi-bin folder is located in your public_html directory (e.g. public_html/cgi-bin).  If you want to run CGI script in a subdomain, put the script the subdomain's cgi-bin directory.


Uploading CGI Scripts


When using FTP, it is very important to upload script files (e.g. .cgi and .pl) in ASCII mode.  FTP clients will give you the option of uploading in ASCII, binary, or "auto."  If "auto" is selected, then make sure .cgi and .pl are considered ASCII files by your FTP client.  Scripts will not execute properly if they are uploaded in binary mode.


Be sure to follow the directions included with the CGI script.


Program Paths

The following paths are commonly needed by scripts.


Path to perl:               /usr/bin/perl

Path to sendmail:       /usr/sbin/sendmail


CGI URL:         

Subdomain CGI URL:


Path to cgi-bin:                       /home/username/domains/

Path to cgi-bin (subdomain):    /home/username/domains/




If these paths don't work, it is possible that your host has installed your account on somewhere other than /home.  Please contact them to get the correct paths.


Viewing Installed Perl Modules

From the main control panel menu click the "Advanced Tools" icon, then the "Installed Perl Modules" icon.



The above picture is a sample cutout of the perl modules list.  If a CGI script requires a specific perl module, check with this list to confirm that the module is installed on the server.


Understanding Permissions

File permissions define who can read, write, and execute files such as scripts.  When the installation instructions ask you to CHMOD a file, you are being asked to set file permissions.  File permissions can by modified by most popular FTP clients or through the control panel's built-in file manager.


Some common permission levels for files are:


600  Makes a file inaccessible

644  Readable by everyone (e.g. HTML documents)

666  File can be read and modified

755  File can be read and executed by everyone

777  Writable and executable by everyone (use with caution)


Most CGI scripts need to be set to 755.  Please refer to the script's documentation for proper installation instructions.


PHP Scripts

PHP scripts are fully supported on all servers running DirectAdmin Web Control Panel.  PHP scripts may be placed and executed in any folder within your public_html directory.  Please refer to the script's documentation for proper file permission and install procedures.


One of the best resources for locating PHP scripts is at:


Accessing phpMyAdmin


phpMyAdmin is a tool written in PHP that allows you to administrate your MySQL databases.  You can execute SQL statements, work with fields (add, edit, delete), work with tables (create, alter, drop), create additional databases, and much more.  phpMyAdmin is intended for advanced users.  Most PHP scripts will automatically setup the database for you, so you probably won't need to use phpMyAdmin..


phpMyAdmin can be accessed at  Please visit for more information on using phpMyAdmin.


Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Microsft frontpage (Views: 832)
Site backup (Views: 687)
General (Views: 626)
Uploading your site (Views: 783)
Site statistics (Views: 949)

Powered by WHMCompleteSolution


Live Chat

Speak with one of our live support reps!


Why Choose Us?

All of our web hosting plans come with the following cool features!
  • Powerful Control Panel
  • Online Based Website Builder
  • 3,000 Free Website Templates
  • One Click Script Installer
  • Unlimited Email accounts
  • Unlimited MySQL Databases
  • FREE Domain Name


Follow Us

Follow Us on Twitter