бУРов Posted January 2, 2010 Report Share Posted January 2, 2010 Хочу научиться запускать perl-скрипт из shtml-файла. Перечитал массу книжек. Везде процедура описана похоже. Сделал тестовый пример. Поставил xampp 1.7.1, Windows XP SP3 Rus Создал два файла. 1 hello.shtml: <HTML><HEAD><TITLE></TITLE></HEAD><BODY><br>Это - hello.shtml<br><!--#exec cgi="/cgi-bin/hello.cgi"-—></BODY></HTML> 2 hello.cgi: #!"c:\xampp\perl\bin\perl.exe" -wprint "Content-Type: text/shtml\n\n";print "Это - Hello.cgi"; 1-й положил в htdocs 2-й положил в cgi-bin Набираю http://localhost/hello.shtml И получаю в браузере следующий вывод: Это - hello.shtml [an error occurred while processing this directive] А ожидаю Это - hello.shtml Это - Hello.cgi Содержимое файла error.log: [sat Jan 02 07:21:31 2010] [warn] pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?[sat Jan 02 07:21:31 2010] [notice] Digest: generating secret for digest authentication ...[sat Jan 02 07:21:31 2010] [notice] Digest: done[sat Jan 02 07:21:32 2010] [notice] Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 configured -- resuming normal operations[sat Jan 02 07:21:32 2010] [notice] Server built: Dec 10 2008 00:10:06[sat Jan 02 07:21:32 2010] [notice] Parent: Created child process 2256[sat Jan 02 07:21:35 2010] [notice] Digest: generating secret for digest authentication ...[sat Jan 02 07:21:35 2010] [notice] Digest: done[sat Jan 02 07:21:36 2010] [notice] Child 2256: Child process is running[sat Jan 02 07:21:36 2010] [notice] Child 2256: Acquired the start mutex.[sat Jan 02 07:21:36 2010] [notice] Child 2256: Starting 250 worker threads.[sat Jan 02 07:21:36 2010] [notice] Child 2256: Starting thread to listen on port 443.[sat Jan 02 07:21:36 2010] [notice] Child 2256: Starting thread to listen on port 80.[sat Jan 02 07:21:38 2010] [error] [client 127.0.0.1] SSI directive was not properly finished at the end of parsed document C:/xampp/htdocs/hello.shtml В чём дело? Я чайник по настройкам Apache - может быть там что поправить нужно? Quote Link to comment Share on other sites More sharing options...
XAKEPok Posted January 2, 2010 Report Share Posted January 2, 2010 Хоть я и сейчас в SSI не особо разбираюсь, но голова моя наталкивает тебя на след. мысль (может и не помочь, но попытка не пытка). Строка в твоём первом файле: <!--#exec cgi="/cgi-bin/hello.cgi"-—> В ней в конце знаки "тире" разные. На страничке http://stepbystep.htmlbook.ru/?id=39 говорится следующее: Если ваш сервер поддерживает SSI, то после открытия файла index.shtml, вы увидите надпись «Работает!». В том случае, когда написано нечто другое или вообще ничего нет, возможны два варианта.Отображается надпись [an error occurred while processing this directive]. Это означает, что SSI работает, но в коде содержится ошибка. Например, добавлены лишние пробелы или указанного файла нет. Вывод: попробуй вышеуказанную строку заменить на следующую: <!--#exec cgi="/cgi-bin/hello.cgi"--> Возможно также в .htaccess нет необходимых строк. Если вариант выше не поможет, почитай эту статью и обрати внимание на ссылки, которые в ней указаны. Quote Link to comment Share on other sites More sharing options...
бУРов Posted January 5, 2010 Author Report Share Posted January 5, 2010 в конце знаки "тире" разныеАй! Спасиба те, мил чел!!! Так оно и случилось-то.Первое - тире с кодом "2D". Второе - тире с кодом "97". Т.н. "длинное". Не ты бы - бросил всё и забыл навеки! :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.