how to fix error 500 Internal Server Error when trying to open my php page in my subdirectory, ?

February 24, 2018 184 views
Apache Ubuntu 16.04

My page has a simple script which is the

echo "Hello";

But I got internal error. I don't know whats happening! . Please do help.

1 comment
  • Please people do help. I just wanted to setup my newly developed web app. I already tested it locally and its working well but when I try to setup here in droplets I got this internal error. even a simple script I still got error. Even if I already setup apache2 and mysql-server.

3 Answers

This could be file permissions.ownership - So if your public_html is under /var/www/example.com you would do something like this.

chown -R www-data:www-data /var/www/example.com

Anything in Apache error logs? Presumably /var/log/apache2/error_log?

And as you're most likely running mod_php it could also be that there's something wrong with php.ini as well. Try running php -v and see if you get anything else than the actual PHP version information.

  • Heres the error logs I got

    [Sun Feb 25 23:54:09.577533 2018] [:error] [pid 13784] [client] PHP Notice: Use of undefined constant \xe2\x80\x9cfailed\xe2\x80\x9d - assumed '\xe2\x80\x9cfailed\xe2\x80\x9d' in /var/www/html/config/index.php on line 12

    and this is the version I have.

    PHP 7.0.25-0ubuntu0.16.04.1 (cli) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.25-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

Have another answer? Share your knowledge.