The Hosting Community
Infotx
Welcome to Infotx - Webmaster Guides and Resources.
Web hosting using PHP.PHP
The php.ini file can be viewed from a web browser. |
|
To prevent people to viewing your php.ini file via a browser a few lines need to be pasted into the .htaccess file. |
How do I change my upload_max_filesize? |
|
In a nutshell:
------------------------------------------------------- Howto optimize your PHP installation to handle large file uploads.Though PHP presents a very versatile and user friendly interface for handling file uploads, the default installation is not geared for working with files in excess of 2 Mega Bytes. This article is an aid to configuring PHP for handling suc h large file transfers. php.iniThe php.ini file contains all the configuration settings for your installation. Sometimes these setting might be overridden by directives in apache .htaccess files or even with in the scripts themselves but for the moment let's just concentrate on the ini file.
The first one is fairly obvious if you set this off, uploading is disabled for your installation. We will cover the rest of the configuration settings in detail below. upload_max_filesize and post_max_sizeFiles are usually POSTed to the webserver in a format known as 'multipart/form-data'. The post_max_size sets the upper limit on the amount of data that a script can accept in this manner. Ideally this value should be larger than the value that you set for upload_max_filesize. memory_limitWhen the PHP engine is handling an incoming POST it needs to keep some of the incoming data in memory. This directive has any effect only if you have used the --enable-memory-limit option at configuration time. Setting too high a value can be very dangerous because if several uploads are being handled concurrently all available memory will be used up and other unrelated scripts that consume a lot of memory might effect the whole server as well. max_execution_time and max_input_timeThese settings define the maximum life time of the script and the time that the script should spend in accepting input. If several mega bytes of data are being transfered max_input_time should be reasonably high. You can override the setting in the ini file for max_input_time by calling the set_time_limit() function in your scripts. Special NotesApache SettingsThe apache webserver has a LimitRequestBody configuration directive that restricts the size of all POST data regardless of the web scripting language in use. Some RPM installations sets limit request body to 512Kb. You will need to change this to a larger value or remove the entry altogether. Other OptionsIf you expect to handle a large number of concurrent file transfers on your website consider using a perl or java server side component. PHP happens to be our favourite web programming language as well but perl is just slightly ahead when it comes to file handling. |
What is FastCGI for PHP? |
|
FastCGI for PHP
Potential Problems:
|
A walkthrough for installing SourceGuardian ixeds into a hosting account. |
|
SourceGuardian is usually already installed on the server your hosting account is on. To get your scripts to use SourceGuardian there are two things that must be done. |
How do I change the PHP environment for my site with php.ini |
|
The servers use a master php.ini file for all directories without a php.ini file in it. You will have a copy of this file in your public_html directory, and you can make any changes to this file, and they will take precedence over the master file. You will need to copy this file into all subdirectories within your site which have php files that you would like to affect. |
How to copy PHP.INI from public_html to all subfolders for PHP directive server overrides |
|
Within public_html create a file with the following syntax included within it: |
How to optimize your PHP installation to handle large file uploads. |
|
Follow this guide and place the php.ini in whatever directory the php file is being executed from. Howto optimize your PHP installation to handle large file uploads.Though PHP presents a very versatile and user friendly interface for handling file uploads, the default installation is not geared for working with files in excess of 2 Mega Bytes. This article is an aid to configuring PHP for handling suc h large file transfers. php.iniThe php.ini file contains all the configuration settings for your installation. Sometimes these setting might be overridden by directives in apache .htaccess files or even with in the scripts themselves but for the moment let's just concentrate on the ini file.
The first one is fairly obvious if you set this off, uploading is disabled for your installation. We will cover the rest of the configuration settings in detail below. upload_max_filesize and post_max_sizeFiles are usually POSTed to the webserver in a format known as 'multipart/form-data'. The post_max_size sets the upper limit on the amount of data that a script can accept in this manner. Ideally this value should be larger than the value that you set for upload_max_filesize. memory_limitWhen the PHP engine is handling an incoming POST it needs to keep some of the incoming data in memory. This directive has any effect only if you have used the --enable-memory-limit option at configuration time. Setting too high a value can be very dangerous because if several uploads are being handled concurrently all available memory will be used up and other unrelated scripts that consume a lot of memory might effect the whole server as well. max_execution_time and max_input_timeThese settings define the maximum life time of the script and the time that the script should spend in accepting input. If several mega bytes of data are being transfered max_input_time should be reasonably high. You can override the setting in the ini file for max_input_time by calling the set_time_limit() function in your scripts. Special NotesApache SettingsThe apache webserver has a LimitRequestBody configuration directive that restricts the size of all POST data regardless of the web scripting language in use. Some RPM installations sets limit request body to 512Kb. You will need to change this to a larger value or remove the entry altogether. Other OptionsIf you expect to handle a large number of concurrent file transfers on your website consider using a perl or java server side component. PHP happens to be our favourite web programming language as well but perl is just slightly ahead when it comes to file handling. |
How can I execute php code as .htm or .html files |
|
In your .htaccess file insert this line of code. |
How do I turn the 'display_errors' flag on for php? |
|
Add 'display_errors = on'" to your public_html/php.ini file. |
The redirection of www.yourdomain.com/default.html or index.html to http://www.yourdomain.com/index.php?act=whatever redirects it to http://www.yourdomain.com/index.php%3fact=whatever |
|
this is a long one.... |
How do I enable the Zend Optimizer on my account? |
|
Zend Versions installed on most hosting servers are: 3.0.1, 3.0.2, 3.2.0, and 3.2.2. |
A walk through to install IonCube into a hosting account. |
|
IonCube is already installed on the server your hosting account is on. To get your scripts to use IonCube there are two things that must be done. |
I get this with some of my php files: |
|
This means that the file was uploaded as ASCII text (plain text) instead of as a binary file (1's and 0's). Some php code requires that it is transfered as a binary file, and not as plain text. Setting your FTP client to force Binary mode, instead of allowing it to auto-detect the mode, will fix this problem 90% of the time. |
Do you support mod_php? |
|
Due to security precautions, most hosting companies currently do not have, or have plans to have, a system with mod_php. |
How do I use PHP? |
|
To use PHP within your account make a file and give it a ".php" file extension (e.g., example.php). Inside this file you can put any HTML that would normally go in a web page. Anywhere in that file, within the HTML, you can put your PHP code. |
How do I view the php information page? |
|
Create a page name phpinfo.php and insert the below code into it. Pull this page up in your browser and this will show the php configuration on the server. |
Help my php site has been exploited or hacked what can I do to make sure this does not happen again? |
|
The programs that operate database-driven sites are vulnerable to hackers, who can (and do) exploit bugs in those programs to gain unauthorized access to your site. |
Emails are not sending out in the correct character sets. Recipients are receiving odd characters instead of the specified set. |
|
This is a known issue with many hosting companies servers. |