Runee:
It sounds like that what you are doing isn't mod_rewrite commands as you claim
but rather you are really trying to change the PHP upload limit using your .HTACCESS.
Unfortunately, using "
php_flag" and "
php_value" commands to override
configuration values in PHP only work on those servers where PHP has been installed
as an insecure Apache DSO module (Usually running as the generic user "nobody").
(
This configuration is not recommended because of major security issues)
Dropping in a new custom PHP.INI file into your account home only works
to override PHP configuration settings if the PHP on the server has been
configured to operate as a CGI directly or as the obsolete and now rarely
used configuration mode called
phpSuEXEC which was one of the legacy
methods used in the days before
SuPHP came along to run scripts as the
account owner instead of user "nobody" but it had it's own set of problems.
Those server which are properly configured today, are now mostly all running
SuPHP which is structured as a special DSO module which in turn calls the
PHP CGI binary and executes the user PHP scripts under the owner username
and unlike the previous two styles of PHP,
SuPHP doesn't have either of the
major security issues or inherent problems found in the earlier PHP installations.
Likewise, the methods of setting up the configuration commands are also different
as well and configuration override commands can still be setup but most be setup
in one of the following forms when the server is running PHP as
SuPHP:
1. Editing the main server PHP.INI file (usually in /usr/local/lib)
2. Overriding the PHP settings in the virtualhost container in
the main httpd.conf file (located in /usr/local/apache/conf)
3. Creating a custom PHP.INI file located in /usr/local/lib/php.ini.d
or in a location specified by the server administrator using the
a "
suPHP_ConfigPath" directive in httpd.conf for your account.
4. Some, but not all, directives can also be changed from within
your PHP scripts using the set_ini() command unless the server
administrator has restricted this function with disable_functions().
One significant difference between SuPHP based PHP and the others
is that end users CANNOT override server PHP settings unless explicitly
allowed for by the server administrator and the server administrator
retains control as to who can and cannot update PHP settings which
is a significant improvement over the other legacy methods of installing
PHP which allowed for the end user to edit too many settings
Quote:
|
Originally Posted by Runee
I am having problems in uploading images with more than 2 MB. I also tried to use custom PHP.INI file. I also tried to use .HTACCESS file. Using .HTACCESS file works well locally but when I tried to use it in this server it generates an error and I cannot browse any of the pages.
|
The statement you made tells me that the server you are using has PHP installed as
SuPHP
and attempting to add commands to your .HTACCESS file will just cause your web site to
generate an error 500 condition and block your web site from working.
Since your server is clearly running the newer
SuPHP instead of the old
phpSuExec,
this would be the reason why dropping in a custom php.ini file did not work for you either
as this is not permitted under
SuPHP unless explicitely setup by the server administrator.
To make the PHP settings changes you requested, you will need to have the limits raised
for PHP uploads either increased server wide across the whole server (
OR) use one of
the valid methods of changing the settings I mentioned previously earlier in this post which
does not involve editing the .HTACCESS file or dropping in custom PHP.INI files unless you
have been setup by the server administrator permission to be able to do that.
.