0

After install apache2 it work fine, but if reinstall php5 that the server doesn't work, if I try to access http://127.0.0.1 a give the error 500, or a file of www folder, if I try to access a folder or a file of a folder all work fine. Error 500 details:

GET http://127.0.0.1/test.php

500 Internal Server Error Запрос GET /test.php HTTP/1.1 User-Agent:

Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.16 Host:

localhost Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 Accept-Language: ru,en;q=0.9
Accept-Encoding: gzip, deflate
Pragma: no-cache
Cache-Control: no-cache
Connection: Keep-Alive
Ответ HTTP/1.0 500 Internal Server Error
Date: Sun, 13 Oct 2013 19:16:25 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.4.9-4ubuntu2.3
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 20
Content-Type: text/html

Not error 500:

 GET http://127.0.0.1/css/


200 OK
GET /css/ HTTP/1.1 
User-Agent: Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.16
Host: localhost Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Accept-Language: ru,en;q=0.9
Accept-Encoding: gzip, deflate
Connection: Keep-Alive Ответ HTTP/1.1 200 OK Date: Sun, 13 Oct 2013 19:21:38 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Content-Encoding: gzip Content-Length: 648 Keep-Alive: timeout=5,max=99
Content-Type: text/html;charset=UTF-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> [...]
  • 1
    What's the content of test.php? – David Foerster Oct 13 '13 at 19:33
  • It is a simple file, it contains "<? php_info() ?>" – L.V.A Oct 13 '13 at 19:52
  • Did you enable short execution tags in the server configuration? Try <?php php_info(); ?> instead. – David Foerster Oct 13 '13 at 20:16
0

You seem to have an error in your PHP File, a PHP Info file should be:

<?php phpinfo(); ?>

<? id depreciated as per this https://stackoverflow.com/a/200666

php_info() is an incorrect function name (unless you have coded this yourself), and should have a closing semi-colon (http://php.net/manual/en/function.phpinfo.php)

  • Work with "<?php"; Can I set php5 to can use only "<?"? In windows I use openserver(with php 5.4) and all work fine with "<?". PHP Version 5.4.9-4ubuntu2.3, – L.V.A Oct 14 '13 at 4:45
  • You can indeed (php.net/manual/en/ini.core.php#ini.short-open-tag) however I wouldn't recommend it, your code is then no longer as easily portable when moving between machines... – Matt Clements Oct 14 '13 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.