asehgal asehgal - 6 months ago 18
PHP Question

php script does not run when called from bash script on MAC OS X

Following is a bash script

that I am trying to use to call a PHP script

# Main script

php -f generateTest.php

Why does this not run when I "double click" the bash script ? It runs on calling from the
on OS X

I get the error message

asehgal-MacBook-Pro:~ asehgal$ /Users/asehgal/projects/configtest/run.command ; exit;
Could not open input file: generateTest.php
Saving session...
...copying shared history...
...saving history...truncating history files...

I have used
chmod +x
to make it executable.


Use the absolute path to your generateTest.php file and it should work, it's not working now because it's trying to find generateTest.php in your current working directory (where you are running run.command from)


# Main script 

php -f /Users/asehgal/projects/configtest/generateTest.php