Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: PHP Command Linke Syntax
04-25-2004, 02:52 PM #1
- Join Date
- Apr 2004
- Thanked 0 Times in 0 Posts
PHP Command Linke Syntax
I used the !#/usr/local/bin/php at the top of the php file that the cron is calling and it said bad interpreter, this is where the which php says it is and I also tried !#/usr/bin/php .....heres the code on the page
$query= "SELECT * FROM `user_data` WHERE 1";
$link = mysql_connect($host, $user, $pass) or die("Could not connect: " . mysql_error());
mysql_select_db($db_name, $link) or die ('Can\'t use '.$db_name.' : ' . mysql_error());
$result = mysql_query($query)or die(" Invalid query: " . mysql_error());
$id = $row[userid];
shell_exec('/usr/bin/php -q /home/iworldli/public_html/adminpnl/dogetmail.php '.$id);
04-26-2004, 03:00 AM #2
- Join Date
- May 2002
- Perth Australia
- Thanked 92 Times in 90 Posts
Hi , first off please do not cross post , I appreciate that you may be unsure which forum to post this in (as I am unsure which forum is appropriate) we can always move threads around for you !
for your question , please explain , is the script above the cron script ? , if so is it the cron script itself that fails or your shell_exec() command within it ?
/usr/local/bin/php is the most common place to find PHP & if thats what 'which' returns, then thats the one to use.
if you are exec()'ing PHP via .. say `/usr/local/bin/php -q -f /path/to/file.php` , you dont need to add the shebang line #!/usr/local/bin/php in file.php as the interpreter is already invoked (nor should it hurt as it will be ignored as a comment)
MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)