Tell me more ×  Is it possible with PHP to execute a command and
thereby replace the current process? Like in C or Ruby:  #
should not get here share|improve this question add comment  1
Answer  up vote 0 down vote accepted  Try pcntl_exec:
share|improve this answer This is what i was looking for. The
only problem was that this function needs full paths to
binaries. I wanted to preload a library when launching an
interactive php shell. It's now pcntl_exec($_SERVER['_'],
array('-ad', 'auto_prepend_file=/path/to/library')). The
$_SERVER['_'] is the path to the php interpreter. –  user1065745
Feb 4 '12 at 12:11 add comment  Your Answer