I have done a a bash script which run php script. It works fine without parameters but when I add parameters (id and url), there are some errors:
PHP Deprec
-- Option 1: php-cgi --
Use 'php-cgi' in place of 'php' to run your script. This is the simplest way as you won't need to specially modify your php code to work with it:
php-cgi -f /my/script/file.php id=19 myvar=xyz
-- Option 2: if you have a web server --
If the php file is on a web server you can use 'wget' on the command line:
wget 'http://localhost/my/script/file.php?id=19&myvar=xyz'
OR:
wget -q -O - "http://localhost/my/script/file.php?id=19&myvar=xyz"
-- Accessing the variables in php --
In both option 1 & 2 you access these parameters like this:
$id = $_GET["id"];
$myvar = $_GET["myvar"];