Linux - running php script from command line when php is installed as apache module

Usually, when I want to run a php script from the command line, I just create a php page, add a shebang pointing to the php binary, then. /file.php to run it. Since I have php installed as an apache module, I don’t even know what my shebang should look like. Any ideas?

+3
source share
2 answers

If it's just an Apache module, I don't think you can do it ... At least not using a script like this:

$ cat run_php_with_apache
#!/bin/sh
cp "$1" /var/www/
curl "http://localhost/`basename "$1"`"
rm "/var/www/`basename "$1"`"
+3
source

CLI PHP 4.3 , PHP . ,

$ php -v

, , .

php , :

$ php -f file.php
+12

Source: https://habr.com/ru/post/1714569/


All Articles