 |
|
 |
 |
 |
Knowledgebase Categories |
|
 |
| Knowledgebase articles are categorized. Please select which category you would like to browse. You can also search the knowledgebase using the search field beside this text. |
|
|  |
 | Articles |  |
|
 | What is PHP? | |
 | PHP is a server-side, cross-platform, HTML embedded scripting language. It has a syntax familiar to both Perl and C. PHP-enabled web pages are treated just like regular HTML pages and you can create and edit them the same way you normally create regular HTML pages. |
|
 |
 | Where can I find mySQL Documentation? | |
 | The official mySQL documentation may be found at: http://www.mysql.com
Other useful information about mySQL may be found at the following locations:
http://mysql.turbolift.com
http://www.devshed.com |
|
 |
 | Where can I find more information on PHP? | |
 | PHP is quickly becoming a very popular scripting language. More information on PHP can be found on the official website, located at....
http://www.php.net
On their website, you can find a listing on all PHP functions, libraries, example scripts, a mailing list for developers, and other useful information. |
|
 |
 | What userid does my PHP scripts run under? | |
 | Your PHP scripts will run under the same userid as the webserver (Apache), which is "nobody". Therefore, since your PHP scripts do not run under your userid, you must take this into consideration when you are trying to create, edit, or modify files with your PHP scripts.
Secondly, PHP scripts run under the group "nobody" as well. All clients are in the group "cust". Therefore, in order to allow PHP to create, modify, and/or delete files within your account, you would need to have world read/write permission on the files and within the directories where the files will be created. |
|
 |
 | What permissions do I need to use on my PHP scripts? | |
 | To avoid any problems, you should set your PHP scripts to 755, or user everything, group and world read and execute permission. |
|
 |
 | What are valid file extensions I can use for PHP scripts? | |
 | The valid file extensions for PHP scripts are listed below:
.php
These file extensions must be used in order for your PHP scripts to run properly. |
|
 |
 | How does VodaHost run PHP? | |
 | VodaHost offers PHP as an Apache module, not as a CGI binary. Thus, clients can take advantage of the benefits of using PHP as an Apache module. |
|
 |
 | Do I have to have a header at the top of my PHP scripts? | |
 | No. Since we are not using PHP as a CGI binary, there is no reason to use the #!/usr/bin/php header in your PHP scripts. Doing so will only cause the header to show up as output as well. |
|
 |
 | Can I use PHP in conjunction with mySQL? | |
 | Absolutely. Once of the big advantages of PHP is the ability to interface to databases, including mySQL. Since we offer mySQL as apart of our service, you can have PHP act as a front-end to your mySQL databases. |
|
 |
 | How do I do mySQL through Perl using the mySQLPerl Module? | |
 | Use the following outline to connect and begin querying the mySQL server from a Perl script. Remember that you cannot connect to your databases remotely due to security concerns, you can only connect from localhost .
1. Declarations
You must require the mySQL package for your script to function properly. Do this by including the following line in your code: use Mysql;
2. Connect To The Database
Somewhere near the beginning of your script, you need to make your initial connection to the database server. Using the following form, substitute your database, username, and password for the examples to connect successfully. The database must be a valid one that you have created through the phpMyAdmin interface in the Control Panel. The username must be the one assigned to you and must have adequate permissions to the specified database.
Mysql->connect('localhost','DATABASENAME','USERNAME','USE RPASSWORD');
3. Executing A Query
You are now ready to begin querying the database server. Most problems that you may incur will generally occur due to invalid permission settings for the specified user. Remember that you can use our convenient web based PhpMyAdmin interface to view or edit these settings. |
|
 |
 | How do I create/edit/delete tables in my database? | |
 | All administration of your mySQL databases can be done through our convenient web based phpMyAdmin interface. This program is provided to all of our web hosting customers with mySQL enabled. It is available in your Control Panel. |
|
 |
 | How do I connect to mySQL through PHP? | |
 | Use the following outline to connect and begin querying the mySQL server from a Perl script. Remember that you cannot connect to your databases remotely due to security concerns, you can only connect from localhost .
1. Declarations
You must require the mySQL package for your script to function properly. Do this by including the following line in your code: use Mysql;
2. Connect To The Database
Somewhere near the beginning of your script, you need to make your initial connection to the database server. Using the following form, substitute your database, username, and password for the examples to connect successfully. The database must be a valid one that you have created through the PhpMyAdmin interface in the Control Panel. The username must be the one assigned to you and must have adequate permissions to the specified database.
Mysql->connect('localhost','DATABASENAME','USERNAME','USE RPASSWORD');
3. Executing A Query
You are now ready to begin querying the database server. Most problems that you may incur will generally occur due to invalid permission settings for the specified user. Remember that you can use our convenient web based PhpMyAdmin interface to view or edit these settings.
Use the following outline to connect and begin querying the mySQL server from within your PHP scripts. Remember that you cannot connect to your databases remotely due to security reasons. You can only connect to them form localhost .
1. Connect To The mySQL Server
Use the following statement to connect to the database server. Substitute the username, and password for ones assigned to you.
MYSQL_CONNECT('localhost','USERNAME','PASSWORD');
2. Select Your Database
Use the following statement to select the database you wish to connect to. Make sure you substitute the example with your database name.
@mysql_select_db("DATABASENAME");
3. Executing A Query
You are now ready to execute your queries. Remember that the databases and users used must be created in the PhpMyAdmin interface in your Control Panel. Most problems that arise with your scripts will be due to incorrect permission settings. |
|
 |
 | How do I create a MySQL database? | |
 |
Click Here to learn how to create a MySQL database in your control panel.
|
|
 |
 | register_globals is disabled in php.ini, please enable it! | |
 |
If are you trying to install osCommerce or another Fantastico scriptand you are getting the below message...register_globals is disabled in php.ini, please enable it!Please follow the below instructions...
1)
Go
to your control panel and then click on File manager.
2)
In
your file manager, enter the public_html folder.
3)
In
the public_html folder you will see a file called .htaccess,
 a) Select the .htaccess file and click edit.
4)
Copy and paste the below at the bottom of .htaccess file and save
it:
php_value register_globals 1
This
will turn your register_globals on and your script will work properly.
|
|
 |
 | About PHPsuexec | |
 | The PHP installation on
our servers runs in CGI PHPsuexec mode. This article provides
information about this mode and details the differences you may
encounter between PHP running in CGI mode and PHP running as an Apache
module.PHPSuexec InformationFile/Directory Permissions When
PHP runs as an Apache Module it executes as the user/group of the
webserver which is usually "nobody". Under this mode, files or
directories that you require your php scripts to write to need to have
777 permissions (read/write/execute at user/group/world level). This is
not very secure because besides allowing the webserver to write to the
file it also allows anyone else to read or write to the file. With
PHP running as CGI with suexec enabled your php scripts now execute
under your user/group level. Files or directories that you require your
php scripts to write to no longer need to have 777 permissions. In
fact, having 777 permissions on your scripts or the directories they
reside in will not run and will instead cause a 500 internal server
error when attempting to execute them to protect you from someone
abusing your scripts. Your scripts and directories can have a maximum
of 755 permissions (read/write/execute by you, read/execute by everyone
else). PHP running as CGI/suexec is much more secure than the older
Apache module method. Files and directories also need to be
owned by your user/group. You probably don't need to worry about this
as all files you upload or create will be owned by your user/group
automatically. .htaccess Under the old
Apache Module mode you were able to manipulate the PHP settings from
within a .htaccess file placed in the script's directory.For example you could turn off the php setting "magic_quotes_gpc" with this line in .htaccess:php_value magic_quotes_gpc on With
PHP running as CGI/phpsuexec manipulating the PHP settings is still
possible however it can not be done with .htaccess. Using .htaccess
with php_value entries within it will cause a 500 internal server error
when attempting to access the scripts. This is because php is no lo |
|
 |
 | About PHPsuexec | |
 | The PHP installation on
our servers runs in CGI PHPsuexec mode. This article provides
information about this mode and details the differences you may
encounter between PHP running in CGI mode and PHP running as an Apache
module.PHPSuexec InformationFile/Directory Permissions When
PHP runs as an Apache Module it executes as the user/group of the
webserver which is usually "nobody". Under this mode, files or
directories that you require your php scripts to write to need to have
777 permissions (read/write/execute at user/group/world level). This is
not very secure because besides allowing the webserver to write to the
file it also allows anyone else to read or write to the file. With
PHP running as CGI with suexec enabled your php scripts now execute
under your user/group level. Files or directories that you require your
php scripts to write to no longer need to have 777 permissions. In
fact, having 777 permissions on your scripts or the directories they
reside in will not run and will instead cause a 500 internal server
error when attempting to execute them to protect you from someone
abusing your scripts. Your scripts and directories can have a maximum
of 755 permissions (read/write/execute by you, read/execute by everyone
else). PHP running as CGI/suexec is much more secure than the older
Apache module method. Files and directories also need to be
owned by your user/group. You probably don't need to worry about this
as all files you upload or create will be owned by your user/group
automatically. .htaccess Under the old
Apache Module mode you were able to manipulate the PHP settings from
within a .htaccess file placed in the script's directory.For example you could turn off the php setting "magic_quotes_gpc" with this line in .htaccess:php_value magic_quotes_gpc on With
PHP running as CGI/phpsuexec manipulating the PHP settings is still
possible however it can not be done with .htaccess. Using .htaccess
with php_value entries within it will cause a 500 internal server error
when attempting to access the scripts. This is because php is no longer
running as an apache module and apache will not handle those directives
any longer. All php values should be removed from your
.htaccess files to avoi |
|
 |
|
|
|
 |
|
|
 |