Wrapping PHP in itself

| | Comments (0)
This is a mental note to myself. Somethings using pre-installed VPS the PHP executed by Apache is lacking the necessary permissions to run binary files (shellscript and built-in commands works fine though). It doesn't generate errors, it simply doesn't work.

Those VPS often has the PHP-CGI version installed and thus you can:

  1. Make your PHP script execute a shell script
  2. Init the shell script with PHP-CGI
  3. Execute
This is how the shell script in step 2 looks like:
#!/usr/bin/php
<?
exec('/home/user/www/mybinaryfiletoexecute');
?>

Note that the binary file must be in your www-dir.


Categories

Leave a comment

About this Entry

This page contains a single entry by Niklas Bivald published on June 10, 2009 6:40 PM.

Adding CSS width support in sIFR was the previous entry in this blog.

The plausible promise is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.21-en