Configuring PHP Settings in a Shared Hosting EnvironmentOctober 14th, 2008 · No Comments
While shared hosting may suit most website requirements, in some cases you’ll need to change some PHP settings. And as you don’t have access to server administration, you’ll need to find other ways of changing these settings. Depending on your web host, there can be three ways of changing the PHP settings.
Changing PHP Settings in Your ScriptsIf you have a very simple PHP application or if all your PHP scripts include a common setting file, you can change the PHP settings using the ini_set() command like this:
However, this unlikely to be the best solution if you need to change PHP settings for a complex web application like a blog or forum. Changing PHP Settings Using .htaccessThis method will set the PHP settings at the directory level. This means that all the PHP scripts residing in the same directory as the .htaccess file will be using the custom settings. This will only work on Apache web servers as IIS doesn’t support .htaccess files. Here’s an example of how to use PHP custom settings in a .htaccess file: php_value upload_max_filesize 5M php_value post_max_size 6M php_value memory_limit 64M php_value session.auto_start 0 For this method to work, you have to make sure the web server’s administrator as set Apache’s “AllowOverride All” parameter for your website’s directory. Changing PHP Settings Using PHP.iniAnother way to customize your PHP settings is to create a file named php.ini and to upload it to your web server. This works in a way similar to the .htaccess file except you don’t have to add “php_value” at the beginning of the line: upload_max_filesize 5M post_max_size 6M memory_limit 64M session.auto_start 0 And what if none of the above works?Unfortunately some web hosts are more restrictive on which settings you can customize and which one you can’t. At this point, you’ll need to contact your server administrator… or switch to another web host! Related Posts |
Popular PostsLatest PostsLatest Deals & Coupons
Recent Comments
Hosting ReviewsRecent WebmastersTag Cloud
1and1
apache
bluehost
cheap web hosting
control panel
coupon
coupon code
cpanel
dedicated servers
dreamhost
fantastico
godaddy
green web hosting
hostdime
hostgator
hostpapa
iis
inmotion hosting
knownhost
linux
lunarpages
mysql
openx
php
reseller hosting
shared hosting
system administration
vps
web hosting
web hosting comparison
Web Hosting Comparisons
whm
windows
windows 2008
wordpress
|
|||||||||
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment