system-wide setting for php exec() search path -


i run php websites on freebsd server updated php 5.2.17, after exec("something") stopped working, , required write exec("/full/path/something").

since scripts run on different machines executables in different places writing full paths not acceptable.

running passthru("set") php reveals path variable (for user "www") be:

path=/sbin:/bin:/usr/sbin:/usr/bin 

i need path point php safe_mode_exec_dir directory:

path=/usr/phpsafe_bin 

running putenv("path=/usr/phpsafe_bin") in php resolves problem, need solution fixes problem on global level php scripts running on machine, in other words changing php.ini, apache settings, or other system settings.

hope can provide solution this, maybe explanation why changed in php update. there seems no php documentation on how search path exec() , friends determined.

it's not pleasant solution, it's think of. create script file change you've suggested , use "auto_prepend_file" in php.ini or .htaccess include script. in effect every php script run have file run before gets executed , directory changed.

caution: need careful using since errors, white space etc in prepend script can break whole pages, existing features such download scripts, or number of unknown effects.

read more: http://php.net/manual/en/ini.core.php


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -