简体   繁体   中英

How to set the environment variable for PHP in Linux?

I'm implementing MediaWiki with the Oracle Database and therefore I need to add TNS_ADMIN variable to my PHP startup environment.

Q1: How do i add TNS_ADMIN variable to PHP Startup environment?

Q2: Is there a specifc file to edit in order to add the env varibale? If so where can i find it on Linux?

If you are using Apache and the apache2handler SAPI , you can use SetEnv ; you can also export the variable from the init script that starts the PHP process (works for all SAPIs). For example, on most (older) Linux-based distros, you'll probably find a file named /etc/init.d/apache2 or /etc/init.d/httpd that is a shell script where you can export variables for that service. Check your OS' equivalent of "man 5 init" for specifics.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM