tylerdees
By:
tylerdees

My website says "The csgoblow.xyz page isn’t working csgoblow.xyz is currently unable to handle this request. HTTP ERROR 500"

November 24, 2016 484 views
Apache Debian

Website doesnt display any php pages or anything at all for a matter of fact. When going to it it gives the error:
"The csgoblow.xyz page isn’t working
csgoblow.xyz is currently unable to handle this request.
HTTP ERROR 500"
Just need help fixing this.

4 Answers

Check your error logs.

  • I don't have the error.log in the directory.

    • Which directory are you checking?

      • This one: /var/log/apache2/error.log

      • Nevermind i found the logs, but i dont understand what i am looking for in the log.
        this is all the text in the log:

        [Wed Nov 23 22:02:42 2016] [notice] Apache/2.2.22 (Debian) configured -- resuming normal operations
        [Wed Nov 23 22:03:57 2016] [notice] caught SIGTERM, shutting down
        [Wed Nov 23 22:04:01 2016] [notice] Apache/2.2.22 (Debian) configured -- resuming normal operations
        [Wed Nov 23 22:04:05 2016] [notice] caught SIGTERM, shutting down
        [Wed Nov 23 22:04:06 2016] [notice] Apache/2.2.22 (Debian) PHP/5.4.45-0+deb7u5 configured -- resuming normal operations
        [Wed Nov 23 22:04:54 2016] [error] [client 24.177.243.68] File does not exist: /var/www/favicon.ico, referer: http://138.197.21.233/
        [Wed Nov 23 22:06:32 2016] [notice] Graceful restart requested, doing restart
        apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
        [Wed Nov 23 22:06:32 2016] [notice] Apache/2.2.22 (Debian) PHP/5.4.45-0+deb7u5 configured -- resuming normal operations
        [Wed Nov 23 22:06:46 2016] [notice] Graceful restart requested, doing restart
        apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
        PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ming.ini on line 1 in Unknown on line 0
        [Wed Nov 23 22:06:46 2016] [notice] Apache/2.2.22 (Debian) PHP/5.4.45-0+deb7u5 configured -- resuming normal operations
        [Wed Nov 23 22:07:29 2016] [notice] Graceful restart requested, doing restart
        apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
        PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ming.ini on line 1 in Unknown on line 0
        [Wed Nov 23 22:07:29 2016] [notice] Apache/2.2.22 (Debian) PHP/5.4.45-0+deb7u5 configured -- resuming normal operations
        [Wed Nov 23 22:08:49 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:10:20 2016] [notice] caught SIGTERM, shutting down
        PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ming.ini on line 1 in Unknown on line 0
        [Wed Nov 23 22:10:21 2016] [notice] Apache/2.2.22 (Debian) PHP/5.4.45-0+deb7u5 configured -- resuming normal operations
        [Wed Nov 23 22:10:28 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:10:29 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:10:35 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:10:39 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:12:50 2016] [notice] caught SIGTERM, shutting down
        PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ming.ini on line 1 in Unknown on line 0
        [Wed Nov 23 22:12:51 2016] [notice] Apache/2.2.22 (Debian) PHP/5.4.45-0+deb7u5 configured -- resuming normal operations
        [Wed Nov 23 22:13:15 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:13:21 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:14:53 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:14:55 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:15:02 2016] [error] [client 24.177.243.68] script '/var/www/info.php' not found or unable to stat
        [Wed Nov 23 22:15:43 2016] [error] [client 24.177.243.68] script '/var/www/info.php' not found or unable to stat
        [Wed Nov 23 22:15:49 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:15:57 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:15:59 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:16:06 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:16:09 2016] [error] [client 24.177.243.68] File does not exist: /var/www/main
        [Wed Nov 23 22:18:29 2016] [error] [client 95.213.177.124] script '/var/www/azenv.php' not found or unable to stat, referer: https://proxyradar.com/
        [Wed Nov 23 22:20:36 2016] [error] [client 24.177.243.68] File does not exist: /var/www/PHPMYADMIN
        [Wed Nov 23 23:20:39 2016] [notice] caught SIGTERM, shutting down
        PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ming.ini on line 1 in Unknown on line 0
        [Wed Nov 23 23:20:40 2016] [notice] Apache/2.2.22 (Debian) PHP/5.4.45-0+deb7u5 configured -- resuming normal operations
        [Wed Nov 23 23:21:02 2016] [notice] caught SIGTERM, shutting down
        PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ming.ini on line 1 in Unknown on line 0
        [Wed Nov 23 23:21:03 2016] [notice] Apache/2.2.22 (Debian) PHP/5.4.45-0+deb7u5 configured -- resuming normal operations
        [Wed Nov 23 23:22:54 2016] [notice] caught SIGTERM, shutting down
        PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ming.ini on line 1 in Unknown on line 0
        [Wed Nov 23 23:22:55 2016] [notice] Apache/2.2.22 (Debian) PHP/5.4.45-0+deb7u5 configured -- resuming normal operations

          1. Where are your files stored?
          2. Did you done any changes to Virtual Hosts file (/etc/apache2/sites-available/, by default it's called 000-default.conf if you don't use SSL)?

          I'm not absolutely sure, but by logs it's looking for files under /var/www instead of default /var/www/html.

          Verify that you have files in correct location and you didn't changed Root location in VH file.

          • This is my default.conf file, im on debian 7.11 so i dont have 000-default.conf

            <VirtualHost *:80>
                ServerAdmin webmaster@localhost
            
                DocumentRoot /var/www
                <Directory />
                    Options FollowSymLinks
                    AllowOverride None
                </Directory>
                <Directory /var/www/>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
                </Directory>
            
                ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
                <Directory "/usr/lib/cgi-bin">
                    AllowOverride None
                    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                    Order allow,deny
                    Allow from all
                </Directory>
            
                ErrorLog ${APACHE_LOG_DIR}/error.log
            
                # Possible values include: debug, info, notice, warn, error, crit,
                # alert, emerg.
                LogLevel warn
            
                CustomLog ${APACHE_LOG_DIR}/access.log combined
            </VirtualHost>
            
            
          • Now it is saying this:

            Not Found
            
            The requested URL /main was not found on this server.
            
            Apache/2.2.22 (Debian) Server at csgoblow.xyz Port 80
            

            Check it out for yourself: csgoblow.xyz

        • I was out of PC some time but looks like you got working it now. :)

          It works!
          

          Is everything working correctly now?

        • Last time when I tried I got It works! message.
          Now I have 404 Not Found, but it's not error 500 anymore.

          When I type http://csgoblow.xyz/ it redirects me to http://csgoblow.xyz/main/. I'm not sure is it your desired effect but it works like that

        • Did you change AllowOverride to yes in your default conf?

          As I see it does require it by tutorial, and I can't see in snippet you posted:

          ...
           <Directory />
                  Options FollowSymLinks
                  AllowOverride None
              </Directory>
              <Directory /var/www/>
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride None
                  Order allow,deny
                  allow from all
              </Directory>
          ...
          

          Try changing it to:

          ...
           <Directory />
                  Options FollowSymLinks
                  AllowOverride All
              </Directory>
              <Directory /var/www/>
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride All
                  Order allow,deny
                  allow from all
              </Directory>
          ...
          

          Maybe that's not about it, but I really don't see anything wrong there.
          Make sure that you restart Apache after changes:

          • /etc/init.d/apache2 restart
        • TBH, there is no such a way for that.

          You can post changed Virtual Hosts file and latest logs. As it's getting better, maybe there is something more.
          Where did you unpacked your file? How does structure of /var/www looks like?

        • ._.

          Is there something different at logs? Basically I can't really say anything without it :(

          • [Thu Nov 24 19:27:13.129797 2016] [:error] [pid 8301] [client 24.177.243.68:64612] PHP Parse error:  syntax error, unexpected 'mysql' (T_STRING) in /var/www/html/index.php on line 9
            [Thu Nov 24 19:27:15.240837 2016] [:error] [pid 8299] [client 24.177.243.68:64613] PHP Parse error:  syntax error, unexpected 'mysql' (T_STRING) in /var/www/html/index.php on line 9
            
            ``` Updated Code
            
          • Why don't you read the actual error message?

          • What is the "actual" error?

          • PHP Parse error: syntax error, unexpected 'mysql' (T_STRING) in /var/www/html/index.php on line 9

Let's start a new answer chain. :P

Did you install all dependencies?
It looks like it doesn't see some mysql.

  • sudo apt-get install php-mysql
  • service apache2 restart
  • root@csgoblow:~# sudo apt-get install php-mysql
    Reading package lists... Done
    Building dependency tree

    Reading state information... Done
    E: Unable to locate package php-mysql

    • What about php5-mysql instead of php-mysql

      • root@csgoblow:~# apt-get install php5-mysql
        Reading package lists... Done
        Building dependency tree

        Reading state information... Done
        php5-mysql is already the newest version.
        0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
        root@csgoblow:~#

        • Share a first few lines of index.php.
          Maybe there is syntax error.

          Note, share 10-15 lines to be exact, because line 9 is problem

          • <?php
            if (!isset($_GET['page'])) {
                header('Location: /main');
                exit();
            }
            
            ini_set('display_errors’,’On’);
            try {
                $db = new PDO('mysql:host=138.197.29.105;dbname=csgo', 'root', ‘dees2190’, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
            } catch (PDOException $e) {
                exit($e->getMessage());
            }
            
            if (isset($_COOKIE['hash'])) {
                $sql = $db->query("SELECT * FROM `users` WHERE `hash` = " . $db->quote($_COOKIE['hash']));
                if ($sql->rowCount() != 0) {
                    $row = $sql->fetch();
                    $user = $row;
                }
            }
            
            
          • You're using ’smart quotes’, that won't work. Use single or double quotes.

          • So basically for all parentheses use quotations?

        • Yep, as @Woet said, change backtics in password to single quotes.

          • can you show me an example, i dont quite know what you mean...

          • Also, what i dont get is that my info.php works on my other droplet, but when i add my php files to/var/www/html it gices the 404 error.

        • Look at this line:

          $db = new PDO('mysql:host=138.197.29.105;dbname=csgo', 'root', dees2190, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
          

          See highlighted characters? That should be ' instead of this.
          So it would be:

          $db = new PDO('mysql:host=138.197.29.105;dbname=csgo', 'root', 'dees2190', array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
          
    • Is there any update in logs? Is error the same

My other Droplet: 138.197.4.60

Go to 138.197.4.60/info.php

Then go to 138.197.4.60/index.php

  • I think we've reached the limit of the community in terms of amount of comments.
    Please use an IRC chat (such as ##php on freenode) if you need more help.

  • Do more one thing.
    Look at this line:

    ini_set('display_errors’,’On’);
    

    Change it to:

    ini_set('display_errors','On');
    

    Save and try again. Look at logs and see is error same

Have another answer? Share your knowledge.