Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Apache2, PHP5 and environment variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apache2, PHP5 and environment variables



That's it! I added the following lines to /System/Library/LaunchDaemons/org.apache.httpd.plist:

    <key>EnvironmentVariables</key>
    <dict>
        <key>FOO</key>
        <string>/bar</string>
    </dict>

and got the following results from exec("export"):

Array
(
[0] => export FOO="/bar"
[1] => export OLDPWD
[2] => export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
[3] => export PWD="/Library/WebServer/Documents"
[4] => export SHLVL="1"
)
Case solved! Thanks all, thanks Axel.

Burt.


On Wed, Apr 16, 2008 at 12:00 PM, Axel Luttgens <email@hidden> wrote:
Le 16 avr. 08 à 17:26, Burt Crépeault a écrit :

Disappointment, it didn't work. I:

1) made sure mod_env is loaded
2) added this to httpd.conf:
<IfModule env_module>
   SetEnv FOO /bar
</IfModule>
3) restarted apache
4) got the same results from my previously posted script. No FOO environment variable to be seen...

Can this have to do with the fact that my script is PHP? When SetEnv passes variables to CGI, does that include PHP?

Hello Burt,

No, on a stock Mac OS X install, PHP runs as an apache module, not as a CGI module.
Perhaps could you try by adding a "EnvironmentVariables" key to the
       /System/Library/LaunchDaemons/org.apache.httpd.plist
file (be sure to keep a copy of the original file).
More info in the man pages for launchctl(1) and launchd.plist(5).

HTH,
Axel _______________________________________________

Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



--
Burt Crépeault
Research Assistant
Centre de Recherche de l'Université Laval - Robert-Giffard
418-663-5741, ext 6844
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Apache2, PHP5 and environment variables (From: "Burt Crépeault" <email@hidden>)
 >Re: Apache2, PHP5 and environment variables (From: "Brian Williams" <email@hidden>)
 >Re: Apache2, PHP5 and environment variables (From: "Burt Crépeault" <email@hidden>)
 >Re: Apache2, PHP5 and environment variables (From: "Burt Crépeault" <email@hidden>)
 >Re: Apache2, PHP5 and environment variables (From: Axel Luttgens <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.