I am a tiny bit unclear about the Home windows System %PATH% variable. After I went the next script with both, php-cli so that as a web page shipped by apache, I recieve different output for that path variable.

// different output for php-cli and php executed by apache webserver
system('echo %PATH%');

How can i alter the PATH variable that's being used using the apache webserver?

My system:

  • Win7 64bit
  • Zend Server Community Edition 5..4 (with Apache, not IIS)

Edit: Sorry, I needed to provide you with a good example to know the issue:

I needed to professional the system('mysqldump .....') command or something like that like this. The thing is, running the script in the command line works, since the MySQL bin path is incorporated in the system's path but running the script via webbrowser does not range from the MySQL bin path within the system's path.

The net system's path is:

C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Programme\Sysinternals;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Zend\ZendServer\bin 

Bit the initial system's path is a lot longer. My real question is now, where's the system's path limited or how can i discover the system's path configurations for that web performed php script?

Use the next rather,

echo getenv('PATH')

Atmosphere variables are per-process in Home windows they're (usually) inherited in the parent process, using the top process setting PATH somewhere-wide path as well as the per-user path. Therefore, if you're running CLI version of PHP beneath your user account, the road will contain your user-defined path, as the Apache process running within service account can get just the system-wide path.

You are able to set the machine-wide path in System Qualities (Control PanelSystem and MaintenanceSystem), Advanced, Atmosphere Variables. Or, In my opinion you are able to set the atmosphere variable in Apache, e.g. using mod_env and also the [cde] directive.

See at SetEnv.

There's a path variable definied.