How do I add paths to the Apache PATH variable?

for ubuntu server, in /etc/apache2/envvars, for centos server, in /etc/sysconfig/httpd, to add:

export PATH=<your php cli path>

and restart apache


That seems awfully strange to me that you are trying to set the PATH from within Apache. Instead, you should be setting the PATH for your system. There are several ways to do this in Mac OS X:

User-specific
For a single user, you can edit ~/.profile and add:

export PATH="$PATH":/opt/local/lib/mysql5/bin:/this-is-a-test

Or you can create/edit ~/.MacOSX/environment.plist and define the PATH that way.

System-wide
On newer versions of Mac OS X, there is a file named "/etc/paths" and there is a folder named "/etc/paths.d" that allow you to extend the default paths. Basically, you would create a file in "/etc/paths.d" that lists all the paths that you wish to add to the default paths. On versions of Mac OS X that do not support this (you can tell based on whether "/usr/libexec/path_helper" exists), one can edit the default paths for all users by placing the export statement above in /etc/profile.