Home News Suggestions To Fix Internal PHP Server Error Require_once 500

Suggestions To Fix Internal PHP Server Error Require_once 500

235
0

 

Over the past few days, some users reported that they had an internal PHP server error require_once 500.

 

 

I am creating a PHP website using a simple PHP website template

This is what index.php looks like

  requires './config.php';requires './functions.php';// echo 'hello';Run (); 

The run () function is in functions.php

  function run () {    include config ('template_path'). '/template2.php';}} 

and here is the template2.php file

  includes 'header.php';Page content ();include 'footer.php'; 

When I run a site on localhost with a WAMP server, it works fine.

php require_once 500 internal server error

However, when I upload this project to the Amazon server, the server returns an HTTP 500 error. If I comment out the required instructions, the page works (say hello). I’m new to PHP, have no idea what the problem is and I need help.

This is an error page

This is a .htaccess file

    FollowSymLinks optionsRewriteEngine OnRewriteCond% {REQUEST_FILENAME}! -RERewriteCond% {REQUEST_FILENAME}! -FRewriteRule ^ (. *) $ Index.php? Page = $ 1 [L] 

folder structure

config .php

   'Test',        'nav_menu' => [            'home' => 'Home',            'about-us' => 'About us',            'Portfolio Works' => 'Portfolio',            'Contact' => 'Contact',        ],        'Portfolio' => [            ["Test", "Test", "Assets / img / Portfolio / Test.jpg", "Film"],            ['Test', 'Test1', "Assets / Img / Portfolio / Test.jpg", "Documentary"],            ['Test', 'Test2', "Assets / Img / Portfolio / Test.jpg", 'Werbung'],        ],        'template_path' => 'template',        'content_path' => 'content',        'pretty_uri' => true,        'version' => 'v2.0',        'link' => '/ peekay',        'about_us' => 'Lorem ipsum',    ];    return isset ($ config [$ key])? $ config [$ key]: null;}} 

What I Want To Do:

Use a custom jQuery script to get the id of the currently selected simple product (which is a child of the custom product). Call the PHP file to load the inventory for this product and reproduce it in jQuery.

However, when trying to access the PHP file, an internal server error is displayed. I get an HTTP 500 error when trying to open a file directly (as far as I know, both should be the same).

How To Fix Internal 500 Server Error On WordPress Site

This error can appear on any website – not just WordPress sites. Because the notification is so general, it can be difficulto decide where to start.

While the internal error is related to the server, the issue is not always related to the server itself. Therefore, there are simpler options to explore before proceeding with the server.

This is the fastest and easiest solution to internal server 500 error. Wait a few seconds, then reload the page. In case, you can open the page in another browser. Sometimes the server receives too many requests and goes into overload mode, which indicates an internal server error. This problem is usually resolved in seconds.

You can also try checking the status of your website on the “Everyone” or “Just me” page. Just copy and paste your website url in the assigned field on the home page of that site. You can use the Down For Everyone or Just Me tool to check the HTTP status of your server and see if your site is down or the issue is with your client.

If you receive an HTTP status other than 200 (“Everything is OK”), you will receive a notification that your site has crashed.

Clearing the browser cache is another recommended quick fix for an internal server error. On Windows and Linux operating systems, you can clear the cache by pressing F5 or Ctrl F5 on your keyboard. On Mac devices, press SHIFT CMD DEL. You can also clear the cache in your browser settings. Just click on the option to clear all cache memory.

For more information on the error, see the server error log. This is useful for pre-selecting possible causes, especially if they are related to one of the active plugins. When you log into your accounthosting record and go into cPanel, you will see “Errors” under “Metrics”.

Click to open a detailed report containing the web server error log messages.

If your hosting plan has different settings, or you are using a different platform, contact your hosting provider for instructions on checking the server error log.