-1

When I visit my site, I get an error:

This page isn’t working my---site.com is currently unable to handle this request. HTTP ERROR 500

I have taken the below steps but no luck.

  1. In shared hosting server, I have changed the php version from 5.6 to 7.0.

  2. Renamed in sites/all the folder "modules" to "nomodules".

  3. In settings.php file, added "ini_set('memory_limit', '128M');"

  4. Renamed sites folder to "nosites"

  5. Un commented RewriteBase / this line in .htaccess file.

  6. Called hosting company and they tested php file and database access. All good in the server.

I tried all of the above one at a time. I get same error. How can I fix the page is not working error in drupal 7 site?


On home directory in shared hosting, I see logs folder. I dont see any apache folder. Once I click logs folder, I saw few zip files. I uploaded the latest one. It might be the one you are asking for. I personally never looked logged files so I do not know what to get out of this log file. I get the same error for other pages. When I visit robots.txt file page, I can see the content. Also uploaded for you to see.

I am not sure what else I could do to fix it. Please let me know if you need any additional info.

https://drive.google.com/open?id=1aQknx9NGz9-xmGSnXQ9vwGpAdvzw1Cwf


Update 1 In cPanel metrics section, I see the below errors:

[Thu Mar 29 10:29:55.504048 2018] [autoindex:error] [pid 1019784:tid 1401110643131018112] [client xxx.xx.xxx.xx AH01276: Cannot serve directory /home/kar2015/a.com/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive

[Thu Mar 29 10:19:52.133400 2018] [autoindex:error] [pid 109815:tid 14001164323507968] [client xxxxxxxx] AH01276: Cannot serve directory /home/kar2015/a.com/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive


Update 2 index.php exists at the root directory.

Permission of index.php is set to 644

Code shows this:

<?php

/**
* @file
* The PHP page that serves all page requests on a Drupal installation.
*
* The routines here dispatch control to the appropriate handler, which then
* prints the appropriate page.
*
* All Drupal code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/

/**
* Root directory of Drupal installation.
*/
define('DRUPAL_ROOT', getcwd());

require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
menu_execute_active_handler();

I just replaced the content by

<?php 
echo "Hello world!"; 
?>

When I visit my page, it prints "Hello world". I guess problem is with the index.php. How can I fix it?

  • Without knowing the actual error, this will be impossible to provide an answer or guidance for. – Kevin Mar 29 '18 at 17:15
  • I think there is an issue with your server configuration. Do you have access to view apache log file on the server? It would be helpful to see why your server is returning 500 error code. – Jay Chand Mar 29 '18 at 17:16
  • Are you talking about the FRONT PAGE ? are the other pages working ? are txt files working like /robots.txt ? try looking in your web server logs for errors (apache is usually /var/log/apache2/error.log) – GiorgosK Mar 29 '18 at 17:16
0

It seems that you index.php file is missing from the site root or at least where the web server is configured as your site root.

Make sure that you have your site correctly deployed at /home/kar2015/a.com/ which seems your host root and that you have an index.php file in it and it's readable by the web server account (usually www-data) a proper permission should be 0644.

Hope it helps.

| improve this answer | |
  • I updated my post. Please let me know if I could provide you additional info. – learn4ever Mar 30 '18 at 16:09
  • Interesting. Can you post your .htaccess file content? It's the only thing that comes to mind that could lead the web server to fail loading the front-controller. Also just to get more insights about your problem are you running Apache or Nginx? – d70rr3s Mar 30 '18 at 16:23
  • Oh I comes to my attention that in your new index.php file content you use the close tag ?> can you check your web server configuration at cPanel and make sure that short_tag option is set? Ex: short_open_tag=On See the docs – d70rr3s Mar 30 '18 at 16:26
  • Talked to hosting company and they said apache is server. short tag is set to on. I cant see it but they can. Also other sites are working and they said short open tag is not the problem. There is google drive link in my post. I just uploaded htaccess and error log. Please take a look. – learn4ever Mar 30 '18 at 17:34
  • Also they told me they can see that some automatic update happened in drupal. Assuming that caused the issue. On 28th, I updated my css file. My site was just fine. Next day I experienced the error. Also, error that I posted in update 1 is no longer exist. – learn4ever Mar 30 '18 at 17:36

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.