1. Howdy! Welcome to our community of more than 125.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
    Dismiss Notice
  2. Add your web host to our brand new web hosting directory (beta).
    Dismiss Notice

PHP Values in Apache VHost

Discussion in 'Programming Help' started by heymrdj, Aug 3, 2008.

  1. heymrdj

    heymrdj The Debian Lover NLC

    I'm not sure how it works, I did it years ago but can't remember. I am installing an app on my VPS that needs increased PHP privileges, but I cannot affect the server's entire php.ini file as I have another app running that is NOT compatible with some of the changes that have to be made.

    These are the values:
     memory_limit  = 32M
    max_execution_time = 60
    register_globals = Off
    magic_quotes_gpc = Off
    magic_quotes_runtime = Off
    upload_max_filesize = 16M
    session.use_trans_sid = Off
    session.gc_probability = 1
    session.gc_divisor = 10
    mbstring.func_overload = 7
    I found an example but it only showed two funtions. The person added these lines between the </IfModule> and </VirtualHost> lines:
     php_value max_execution_time 60 
    php_flag register_globals Off 
    He used those to give it the special php settings.
    I'm using a vhost of application.eahome.org, with the appropriate A records ect. I just need to know how to get above into a Vhost configuration. Thanks for the help. :beer:
  2. heymrdj

    heymrdj The Debian Lover NLC

    Ok I worked it out. I made my Vhost the following way:

    <VirtualHost *:80>
    DocumentRoot "/var/www/vhosts/www.eahome.org/htdocs/egw/"
    ServerName egw.eahome.org
    <Directory "/var/www/vhosts/www.eahome.org/htdocs/egw/">
    allow from all
    Options +Indexes
    php_value memory_limit 32M
    php_value max_execution_time 60
    php_flag register_globals Off
    php_admin_flag safe_mode off
    php_flag magic_quotes_gpc Off
    php_flag magic_quotes_runtime Off 
    php_value upload_max_filesize 16M 
    php_flag session.use_trans_sid Off
    php_value session.gc_probability 1
    php_value session.gc_divisor 10 
    php_value mbstring.func_overload 7 
    Verified by a phpinfo in that domain, it changed the local php functions and not the master server's. The only problem with this is it MUST be accessed via egw.eahome.org and cannot be eahome.ore/egw, if it's called the latter way the server's normal php.ini takes over and screws it up. Looks like I might be using .htaccess after all.

Share This Page