Changing php_value for one vhost in fcgi...

Discussion in 'Installation/Configuration' started by yoplait, Apr 16, 2010.

  1. yoplait

    yoplait Member

    Hi there,
    I'm searching a way to use fcgi and to change the value of post_max-size and upload_file_maxsize for one site of my ispconfig configuration...

    I understood that the global file is the /etc/php5/cgi/php.ini and it takes effect for all the sites with this. But how can i proceed for just one website ?

    - I tried with an .htaccess at the website web folder,
    - I tried with a directive in the vhost apache file,
    - I tried with the options field, in ispconfig interface,

    The phpinfo() file, on this website never changes...

    ispconfig 3.0.2
    OVH installation, Debian Lenny.

    Thanks a lot !
     
  2. yoplait

    yoplait Member

    I can't imagine there is no solution about this problem...How do you do when you want to change a php value for a website usually with ispconfig3 ?
     
  3. mike_p

    mike_p Member

    I've just tested this on my server (Centos5.4, but should work for any variation!)

    1/ Go to the "sites" tab in the admin control panel
    2/ Select the website from the list
    3/ Select the website's "options" tab
    4/ Within the apache directives add
    Code:
    php_admin_value post_max_size 16M
    php_admin_value upload_max_filesize 10M
    (or whatever value you want!)
    5/ Click save
    6/ WAIT for ISPconfig to process the job queue
    7/ Test using PHPinfo()

    et Voila!

    --- edited to say
    please note: make sure you get the setting names correct. Your post had them mistyped!
     
    Last edited: Apr 18, 2010
  4. yoplait

    yoplait Member

    I tested exactly what you said, it does nothing at all... (The setting names was correct before too :p ).
    I tried a php.ini (with apache2 restart), nothing changes...

    The only setting that can change something is in the /etc/php5/cgi/php.ini, but it will affect all websites ... :(

    I wonder of your configuration. What's your php option ? fcgi ? cgi ? suexec... etc ? (I'm confused with theses settings...)
    Maybe a "strict" setting that I didn't think about ?
     
  5. yoplait

    yoplait Member

    Of course, do it in a global way should be ok, but the question is primary about my curiosity ! :p

    I've got really just one big site whereas others are very little ones... Moreover, the "client" want sometimes some php_value to be changed...

    Anyway, I'm really frustated because I can't understand why it doesn't work ... :(
     
  6. yoplait

    yoplait Member

    I understand your point of view, and I think you're right, but I never tried to use VM and I don't have enough money to pay a new server and test it like this ^^ .

    For my problem : the php.ini, in the website web folder, doesn't change anything...
    I tried
    Code:
    post_max_size 49M
    upload_max_filesize 49M
    
    and
    Code:
    php_value post_max_size 49M
    php_value upload_max_filesize 49M
    
    I changed the owner of the php.ini from root to the web##:client## user,
    I reloaded apache...
    nothing :( ...
    When you say "local php.ini is the only way"... You speak about the global php.ini file ?
     
  7. falko

    falko Super Moderator Howtoforge Staff

  8. yoplait

    yoplait Member

    I didn't know the php-fcgi-starter file, but it doesn't work either...
    Is there a variable, somewhere, that tells apache2 to do not take in consideration the local settings ?

    I tried in CGI only, in fast-cgi, (and without suexec, ssi...)...it's the same ...
     
  9. falko

    falko Super Moderator Howtoforge Staff

    Can you post your current vhost configuration?
     
  10. yoplait

    yoplait Member

    Here is my vhost where "domaine" is my domain :p .
    Code:
    <Directory /var/www/domaine.org>
        AllowOverride None
        Order Deny,Allow
        Deny from all
    </Directory>
    
    <VirtualHost *:80>
          DocumentRoot /var/www/clients/client0/web4/web
      
        ServerName domaine.org
        ServerAlias www.domaine.org
        ServerAdmin [email protected]
    
        ErrorLog /var/log/ispconfig/httpd/domaine.org/error.log
    
        ErrorDocument 400 /error/400.html
        ErrorDocument 401 /error/401.html
        ErrorDocument 403 /error/403.html
        ErrorDocument 404 /error/404.html
        ErrorDocument 405 /error/405.html
        ErrorDocument 500 /error/500.html
        ErrorDocument 503 /error/503.html
    	
        <Directory /var/www/domaine.org/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
        <Directory /var/www/clients/client0/web4/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    
        # php as cgi enabled
        ScriptAlias /php5-cgi /var/www/php-cgi-scripts/web4/php-cgi-starter
        Action php5-cgi /php5-cgi
        AddHandler php5-cgi .php .php3 .php4 .php5
        <Directory /var/www/php-cgi-scripts/web4/>
            Order allow,deny
            Allow from all
        </Directory>
    
        # add support for apache mpm_itk
        <IfModule mpm_itk_module>
          AssignUserId web4 client0
        </IfModule>
    
    
    </VirtualHost>
    
     
  11. yoplait

    yoplait Member

    nothing at all.
     
  12. yoplait

    yoplait Member

    I did the falko's tutorial, but nothing change...
    I think I have to declare I can't find the way to make it works. too bad for me !

    I think that something is blocking this solution of changing a website php value, but I can't see which one is it.

    Thanks for your help, I will try to understand other easier things :p .
     
  13. falko

    falko Super Moderator Howtoforge Staff

    What's in /var/www/php-cgi-scripts/web4/php-cgi-starter?
     
  14. yoplait

    yoplait Member

    There is that :
    Code:
    # cat /var/www/php-cgi-scripts/web4/php-cgi-starter 
    #!/bin/sh
    
    exec /usr/bin/php-cgi \
    -d open_basedir=/var/www/clients/client\[client_id\]/web4/web:/var/www/clients/client\[client_id\]/web4/tmp:/var/www/domaine.org/web:/srv/www/domaine.org/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin \
    -d upload_tmp_dir=/var/www/clients/client0/web4/tmp \
    -d session.save_path=/var/www/clients/client0/web4/tmp
    # -d safe_mode=${SAFE_MODE}
    
    I also tried this, but it doesn't work... :
    Code:
    [# cat /var/www/php-cgi-scripts/web4/php-cgi-starter 
    #!/bin/sh
    
    exec /usr/bin/php-cgi \
    -d open_basedir=/var/www/clients/client\[client_id\]/web4/web:/var/www/clients/client\[client_id\]/web4/tmp:/var/www/domaine.org/web:/srv/www/domaine.org/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin \
    -d upload_tmp_dir=/var/www/clients/client0/web4/tmp \
    -d session.save_path=/var/www/clients/client0/web4/tmp
    -d post_max_size=49M
    -d upload_max_filesize=49M
    # -d safe_mode=${SAFE_MODE}
    
     
  15. mike_p

    mike_p Member

    I don't know if this helps...but...

    in a shell script you should use a backslash at the end of each line if it continues to the next line. In your second version "-d post_max_size=49M" will be seen as a totally seperate command.
     
  16. yoplait

    yoplait Member

    HouaOUuuuuu ! That was this little "\" !!!

    So like this, it works well, thanks you very much !
     

Share This Page