Problem occurs only when running php script at the command line.
Here is an example:
<?php
//myscript.php
//-should be called from some page.
//-sets cookie on visitor's first visit - expires in 2 days (default).
//-does this and that (and also the other thing).
//records special data in /var/blah.txt (when using another-script.php).
//////////files//////////
$blah = '/var/blah.txt'
/////////////////////////
phpinfo()
?>
When I try to run this script at the command line, the comments produce errors:
rh9 [/root] # ./myscript.php
../myscript.php: line 1: ?php: No such file or directory
../myscript.php: line 2: //myscript.php: No such file or directory
../myscript.php: line 3: //-should: No such file or directory
../myscript.php: line 8: unexpected EOF while looking for matching `''
../myscript.php: line 12: syntax error: unexpected end of file
Is there something I need to set in php.ini, or am I missing something?
Thanks in advance.
Here is an example:
<?php
//myscript.php
//-should be called from some page.
//-sets cookie on visitor's first visit - expires in 2 days (default).
//-does this and that (and also the other thing).
//records special data in /var/blah.txt (when using another-script.php).
//////////files//////////
$blah = '/var/blah.txt'
/////////////////////////
phpinfo()
?>
When I try to run this script at the command line, the comments produce errors:
rh9 [/root] # ./myscript.php
../myscript.php: line 1: ?php: No such file or directory
../myscript.php: line 2: //myscript.php: No such file or directory
../myscript.php: line 3: //-should: No such file or directory
../myscript.php: line 8: unexpected EOF while looking for matching `''
../myscript.php: line 12: syntax error: unexpected end of file
Is there something I need to set in php.ini, or am I missing something?
Thanks in advance.
Comment