|
#51
|
||||
|
||||
|
Quote:
post_max_size = 20M; ...but you can check that yourself by putting it in php.ini and looking at phpinfo(); |
|
#52
|
|||
|
|||
|
This script creates a private, modified copy of php.ini and installs symlinks to it in each directory in your website directory tree. I wrote it based on a script quoted earlier in this thread to automate an otherwise tedious process. I run it periodically with cron to keep my modified php.ini up to date with any host changes.
It will create a modified php.ini in your home directory named local_php.ini from the system copy at /usr/local/lib/php.ini. It will then place a symbolic link named php.ini in each directory in your website pointing to your local_php.ini. Note that this script will unlink any php.ini already in a directory it visits, so be careful. Also, be sure to consult phpinfo() for the location of your host's php.ini. PHP Code:
|
|
#53
|
|||
|
|||
|
my .htaccess file only contains:
Quote:
I have some htaccess.txt files that seem to be joomla files. |
|
#54
|
|||
|
|||
|
php_value max_execution_time 300
php_value memory_limit 8M php_value post_max_size 20M php_value upload_max_filesize 20M Putting these in the .htaccess, will that work at the sub folder level or must that be at the web root of the domain? |
|
#55
|
|||
|
|||
|
Quote:
Before you do anything, create yourself a phpInfo page so you know what your settings are. Create a page with the following content, then upload to your website and view it in your browser. Then search for the parameters you listed above to see what the settings are. Code:
<?php phpinfo (); ?>
__________________
- David Folding@Home Stats : |
|
#56
|
|||
|
|||
|
I also modified the script a bit to include the scenario where someone wants to erase all the symbolic links.
I did the symbolic way but didnt like all those symbolic links in the subfolders. So I needed a way to delete all the symbolic links. You can see the code on my blog page here. I also wrote another script to copy php.ini to all the main domain folders (not sub folders). Hope this helps someone. Scott - bargainscent.com - online bargains drinkgenius.com - drink recipes |
|
#57
|
||||
|
||||
|
whitespace, can you please place those unrelated links in your signature rather than the body of the message? Thanks.
|
|
#58
|
||||
|
||||
|
Perhaps this will help, as well:
If you have SSH access (which can be requested), you can use the following command from shell: Code:
phpiniuser='USERNAME' && cat /usr/local/lib/php.ini | replace 'register_globals = On' 'register_globals = Off' > /home/$phpiniuser/php.ini && chown $phpiniuser. /home/$phpiniuser/php.ini You can then add the following code to your .htaccess file: Code:
<IfModule mod_suphp.c> suPHP_ConfigPath /home/USERNAME <Files php.ini> order allow,deny deny from all </Files> </IfModule> Whenever someone requests a custom php.ini file through a support ticket, I have a hotcommand that fires a similar line that copies the file, chowns it, and auto-creates a .htaccess file in the /home/username. Since .htaccess interits by parent, then anything in /home/username/.htaccess will apply to all directories, thus the php.ini will apply. The FULL line I use to do all of this is: Code:
phpiniuser='USERNAME' && cat /usr/local/lib/php.ini | replace 'register_globals = On' 'register_globals = Off' > /home/$phpiniuser/php.ini && chown $phpiniuser. /home/$phpiniuser/php.ini && echo "######################################################" >> /home/$phpiniuser/.htaccess && echo "# Custom php.ini setup added by support, do not edit #" >> /home/$phpiniuser/.htaccess && echo "######################################################" >> /home/$phpiniuser/.htaccess && echo "<IfModule mod_suphp.c>" >> /home/$phpiniuser/.htaccess && echo " suPHP_ConfigPath /home/$phpiniuser" >> /home/$phpiniuser/.htaccess && echo " <Files php.ini>" >> /home/$phpiniuser/.htaccess && echo " order allow,deny" >> /home/$phpiniuser/.htaccess && echo " deny from all" >> /home/$phpiniuser/.htaccess && echo " </Files>" >> /home/$phpiniuser/.htaccess && echo "</IfModule>" >> /home/$phpiniuser/.htaccess && echo "### RESUME EDITING BELOW #############################" >> /home/$phpiniuser/.htaccess && chown $phpiniuser. /home/$phpiniuser/.htaccess Regards, -Eric
__________________
-- Hostgator.com, LLC Linux Systems Administrator ![]() Gator, mushroom, snake? |
|
#59
|
|||
|
|||
|
__________________
- David Folding@Home Stats : |
|
#60
|
|||
|
|||
|
Ah, so are you saying that I now don't need to use the script I currently use, which I found here ages ago, which makes gazzilions of symbolic links in all the subdirectories to the edited copy of php.ini which is in the root folder?
So I'm guessing that .htaccess will now take care of the subdirectories? It's just that I remember before that php.ini was only acting on the folder it was in. This looks like a much better solution. |
![]() |
| Bookmarks |
| Thread Tools | |
|
|