HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=16)
-   -   Ignored phpvalues at .htaccess, ISPconfig or PHP (http://www.howtoforge.com/forums/showthread.php?t=17907)

mbria 2nd December 2007 13:52

Ignored phpvalues at .htaccess, ISPconfig or PHP
 
Hi all,

One of my new sites requires some special tunning of php_values, but never mind where I set them, it didn't work.

My server is:
- ubuntu 7.04 (following perfect setup)
- suPHP (following suPHP howto)
- ISPconfig 2.2.16

My goal is setting those variables as follows, just in one site:

* post_max_size=100M
* upload_max_filesize=100M
* max_execution_time=1000
* max_input_time=1000

I tried at ISPconfig setting "Apache Directives" to:

PHP Code:

...
<
Directory /var/www/web3/web>  
Options +Includes +FollowSymlinks -Indexes  
AllowOverride All  
Order allow
,deny  
Allow from all
php_value post_max_size 500
<Files "^\.ht">  
Deny from all  
</Files>  
</
Directory>
... 

And also at it's own .htaccess with multiple variants:

PHP Code:

#php_value post_max_size "100M"
#php_value upload_max_filesize "100M"
#php_value max_execution_time "1000"
#php_value max_input_time "1000"
<IfModule mod_php5.c>
php_flag post_max_size 50
php_value post_max_size 50
</IfModule

Finally I tried directly at the CMS (it's a Drupal) config file... where other variables are set:

PHP Code:

ini_set('post_max_size',            '100M');
ini_set('upload_max_filesize',     '100M');
ini_set('max_execution_time',    '1000');
ini_set('max_input_time',           '1000'); 

As said, non of those solutions work.

Any clue about how to fix this?

Thanks a lot for your self,

m.

till 2nd December 2007 22:31

You can not set php:admin or php_flag values with SuPHP. This is nothing ISPConfig specific, suphp uses php as cgi internally and you can never set these values for a cgi php.

If you want to set custom values, you will have to make a custom php.ini file and set this in the apache directives (see suphp documentation for details).

mbria 3rd December 2007 01:19

suPHP Custom php.ini
 
Thanks a lot till for the indications.

If I understand you (and some other posts in this forum about similar issues), if I like different php.inis for each site I just need to change my "ISPconfig Apache Directives" requesting it.

If I catch it, it means:

PHP Code:

<Directory /var/www/web3/web>  
Options +Includes +FollowSymlinks -Indexes  
AllowOverride All  
Order allow
,deny  
Allow from all
php_value post_max_size 500
<Files "^\.ht">  
Deny from all  
</Files>  
</
Directory>
suPHP_ConfigPath /var/www/web3/etc/php.ini 

And after this:

1) cp /etc/php5/cgi/php.ini /var/www/web3/etc/php.ini
2) vim /var/www/web3/etc/php.ini (to include my specific changes)
3) /etc/init.d/apache2 restart

But unfortunately, a phpinfo I run on this site still shows default settings.

Did I miss something?

Sorry in advance for the newbie questions. :-(

Thanks again for your help,

m.

mbria 3rd December 2007 02:00

Funny... don't ask me why, but now it's perfectly working.

I commented some redirection "Apache Directives" and the magic flows:

PHP Code:

suPHP_ConfigPath /var/www/web3/etc/php.ini

RewriteEngine on
# RewriteCond %{HTTP_HOST}   ^test.mysite.org [NC]
# RewriteRule   ^/(.*)$ /test/$1  [L]
# Rewrite flv files to actual file.
# RewriteCond %{REQUEST_URI}    ^.*flv$
# RewriteRule ^(.*)system\/(.*)$        $1$2 [L]

<Directory /var/www/web3/web>  
  
Options +Includes +FollowSymlinks -Indexes  
  AllowOverride All  
  Order allow
,deny  
  Allow from all
  
<Files "^\.ht">  
    
Deny from all  
  
</Files>  
</
Directory>

<
Directory /var/www/web3/*/files>  
  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
  Options None
  Options +FollowSymLinks
</Directory> 

Thanks a lot for your help. You can imagine how much happy am I now. ;-)

Cheers,

m.

paxpacis 19th March 2009 10:59

I know this post is from 2007 but I just installed suPHP.

Will this change the php.ini path for every website? or just web3?

suPHP_ConfigPath /var/www/web3/etc/php.ini

Regards.

till 19th March 2009 11:00

This changes the path onöy for the website were you added it in the apache directives field.

paxpacis 19th March 2009 15:52

Hi Till,

Thank you for the quick reply. I thought because this entry is before the <directory> it was a global setting.

So just to clarify, I can add several of these

suPHP_ConfigPath /var/www/web3/etc/php.ini
suPHP_ConfigPath /var/www/web4/etc/php.ini

And they will be used only by web3 and web4?

Quote:

Originally Posted by till (Post 176006)
This changes the path onöy for the website were you added it in the apache directives field.


till 19th March 2009 16:13

The content of the apache directives is only for the website were you add it! This means you can add there only things for this specific wenbsite. If you want to set a php.ini for another website, you will have to add it in the apache directives field of the other website of course.

paxpacis 19th March 2009 16:18

Ah sorry, I missed the part that I have to make it an apache directive. It is totally clear now.. thanks again..

Quote:

Originally Posted by till (Post 176057)
The content of the apache directives is only for the website were you add it! This means you can add there only things for this specific wenbsite. If you want to set a php.ini for another website, you will have to add it in the apache directives field of the other website of course.


paxpacis 16th December 2009 13:39

Forget this post.. please delete, when I read my own post, I saw I missed the = sign.. sorry..


All times are GMT +2. The time now is 20:54.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.