The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SetEnv in vhost.local not being seen in php.ini

Discussion in 'General Discussion' started by zorrobyte, Jun 4, 2015.

  1. zorrobyte

    zorrobyte Registered

    Joined:
    Jun 4, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Indiana
    cPanel Access Level:
    Root Administrator
    Greetings!

    I have a SetEnv in my vhosts.local:
    SetEnv newrelic_appname [% wildcard_safe(vhost.servername) %]

    You can see that this is working:

    line:
    _SERVER["newrelic_appname"]

    So I set in my php.ini:
    /usr/local/lib/php.ini
    newrelic.appname = “${newrelic_appname}”

    This should be getting the SetEnv from apache and replacing it with domain.com, however php is not able to access Apache's ENV as it defaults to the default newrelic.appname.

    Just to be sure, I can change newrelic.appname = "ANYTHING" and it does indeed change.

    How can I access Env variables in vhost.local from php?
     
    #1 zorrobyte, Jun 4, 2015
    Last edited by a moderator: Jun 4, 2015
  2. zorrobyte

    zorrobyte Registered

    Joined:
    Jun 4, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Indiana
    cPanel Access Level:
    Root Administrator
    I was able to figure this out!

    I changed my php config to use suexec instead of fcgi. It's a bit slower then fcgi but it works :)
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page