In this case you need PHP installed as binary (CGI) and add something like
To your php script.
So to compile PHP for that purpose for instance do
Code:
#!/bin/bash
cp php*.tar.bz2 /usr/src
cd /usr/src
bzip2 -dc php*.tar.bz2 | tar xvf -
cd php*
./configure \
--prefix=/tmp/php \
--enable-ftp \
--enable-static \
--enable-tokenizer \
--disable-xml \
--without-pear \
--with-mysql=/usr \
--with-config-file-path=/etc \
make
make install
cp php.ini-dist /etc/php.ini
strip /tmp/php/bin/php
mv /tmp/php/bin/php /usr/bin
rm -r /tmp/php /usr/src/php*
You might need to change the variable max_execution_time in /etc/php.ini afterwards (if it's > 30 secs).
Example script:
Code:
#!/usr/bin/php -q
<?php
print "hello world\n";
?>
Remember the php script needs execution rights ... so chmod +x <filename>