Установка php Скрипта исполняемым файлом
Пользователи, просматривающие топик: none
|
Зашли как: Guest
|
Имя |
Сообщение |
<< Старые топики Новые топики >> |
|
|
Установка php Скрипта исполняемым файлом - 2009-02-18 12:57:06.470000
|
|
|
motorola
Сообщений: 64
Оценки: 0
Присоединился: 2007-11-13 19:44:42.273333
|
Привет. Устанавоиваю chmod +x cmd.php в начале php шника прописываю путь к php #!/usr/local/bin/php -q . запускаю ./cmd.php выдаёт
Usage: php [options] [-f] <file> [--] [args...]
php [options] -r <code> [--] [args...]
php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
php [options] -- [args...]
php [options] -a
-a Run interactively
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f <file> Parse and execute <file>.
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-r <code> Run PHP <code> without using script tags <?..?>
-B <begin_code> Run PHP <begin_code> before processing input lines
-R <code> Run PHP <code> for every input line
-F <file> Parse and execute <file> for every input line
-E <end_code> Run PHP <end_code> after processing all input lines
-H Hide any passed arguments from external tools.
-s Display colour syntax highlighted source.
-v Version number
-w Display source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.
args... Arguments passed to script. Use -- args when first argument
starts with - or script is read from stdin
--ini Show configuration file names
--rf <name> Show information about function <name>.
--rc <name> Show information about class <name>.
--re <name> Show information about extension <name>.
--ri <name> Show configuration for extension <name>.
пробывал подставлял разные опции "#!/usr/local/bin/php -a ", не получаеться. Наверное php перекомпилить надо, только с какой опцией? Ставил php из портов
|
|
|
RE: Установка php Скрипта исполняемым файлом - 2009-02-18 13:12:23.386666
|
|
|
rgo
Сообщений: 7170
Оценки: 281
Присоединился: 2004-09-25 05:14:25
|
...
-f <file> Parse and execute <file>
... Ещё вопросы? ;)
|
|
|
RE: rgo - 2009-02-18 13:26:33.480000
|
|
|
motorola
Сообщений: 64
Оценки: 0
Присоединился: 2007-11-13 19:44:42.273333
|
есть #!/usr/local/bin/php -f /usr/local/www/data/cmd.php Could not open input file: /usr/local/www/data/cmd.php
|
|
|
RE: rgo - 2009-02-18 13:50:53.503333
|
|
|
jonson666
Сообщений: 117
Оценки: 0
Присоединился: 2008-02-19 23:20:01.513333
|
chmod 755 "твой файл". Он должен быть доступен на чтение!
|
|
|
RE: rgo - 2009-02-18 14:09:30.093333
|
|
|
motorola
Сообщений: 64
Оценки: 0
Присоединился: 2007-11-13 19:44:42.273333
|
о вот так заработало #!/usr/local/bin/php -с, тока когда подключаюсь . telnetom к серваку и начинаю вводить, всё вводимые символы выводяться в диагональ, настроил через inetd на 3309 порт
#!/usr/local/bin/php -c
<?
function out_dat()
{
$fn=fread(STDIN,250);
// $fn=fgetc(STDIN);
$fn=trim($fn);
$b=fopen('log.txt','a');
fwrite($b,"$fn\n");
fclose($b);
echo "$fn\n";
//echo "len".strlen($fn);
return $fn;
}
while (out_dat()!='exit')
|
|
|
RE: rgo - 2009-02-18 18:10:47.696666
|
|
|
Parano1d
Сообщений: 423
Оценки: 0
Присоединился: 2008-05-21 13:40:17.093333
|
не понимаю… я без всяких опций делаю… просто #!/usr/local/bin/php
|
|
|
RE: rgo - 2009-02-19 09:29:46.136666
|
|
|
rgo
Сообщений: 7170
Оценки: 281
Присоединился: 2004-09-25 05:14:25
|
quote:
ORIGINAL: motorola telnetom к серваку и начинаю вводить, всё вводимые символы выводяться в диагональ[…] С венды небось входишь? Выкинь на помойку cmd.exe и поставь cygwin с его телнетом.
|
|
|
|
|