Manuals
RU EN

Start · 63

500 Error After Script Installation

Start 6 min read

HTTP 500 means the server stumbled and did not show details to the browser. A white screen with status 200 is often the same Fatal Error with display_errors disabled. Guessing from the outside is pointless; you need the log.

After a fresh installation, the top three causes are wrong PHP version, .htaccess conflict, and MySQL connection error. Next come permissions and memory limits.

Where to look for the log

  • Shared hosting: "errors" section, logs/ in the home directory, sometimes error_log in the site root.
  • Apache: /var/log/apache2/error.log or the virtual host log.
  • Nginx + PHP-FPM: nginx error.log and FPM pool log, path in pool.d.
  • Local MicroServer: Apache/PHP log from the panel or server log directory.

Find the timestamp of your request. One Fatal Error line saves an hour of clicking through the admin panel.

PHP version and syntax

A script for 8.x on a domain running 7.4 gives typical Parse error / unexpected token. Switch PHP to 8.1+ in the panel. Requirements: PHP and MySQL.

Missing extension means messages like Call to undefined function mysqli_connect(). Install mysqli/mbstring/gd; do not upload the archive again.

.htaccess and Nginx

On Apache, a bad .htaccess gives 500 on all URLs. Common causes: unknown directives, php_value under CGI/FPM where it is forbidden, broken rewrite.

On Nginx, .htaccess is ignored. Clean URL rules must be moved to config. If after moving from Apache to Nginx everything is 404/500, look at vhost, not PHP: Nginx + PHP-FPM.

Quick test: temporarily rename .htaccess and open the home page. If it works, even without clean URLs, investigate rewrite.

Database

Access denied and connection refused look like 500 when display_errors=Off. The log will show SQLSTATE 1045/2002. Checklist: connection error. Old passwords in config after migration are a classic case.

Permissions and writing

If PHP cannot create a session or cache file, it may produce Fatal or Warning with permission denied. Upload/cache directories must be writable and owned by the PHP pool user: chmod.

Memory and limits

Allowed memory size exhausted: raise memory_limit for the domain. Maximum execution time: heavy import. Large uploads are cut by upload_max_filesize / post_max_size or client_max_body_size in Nginx, sometimes with another error rather than 500.

How to temporarily see the error

On production, use the log. On staging, you can add:

ini_set('display_errors', '1');
error_reporting(E_ALL);

or enable it in php.ini / panel. Do not leave display_errors=On on production with real users; it exposes paths and SQL.

If there is a white screen after migration. In 90% of cases it is database config, autoloader path, wrong document root, or PHP below the required version. Do not start with a full reinstall before reading error_log.

Checklist in order

  1. Open error_log by request time.
  2. Check PHP 8.x and modules.
  3. Test MySQL connection with the same credentials as in config.
  4. Check .htaccess / Nginx config.
  5. Check cache/upload permissions.
  6. Check memory_limit.

Clean installation: installation. Migration: migration. Hosting lacks modules: choose hosting or VDS. To support, send log text without passwords: support.

White screen without status 500

Sometimes status is 200 and body is empty. For the user, it is the same. Causes are usually Fatal Error / Parse Error. Enable logging, do not guess. On shared hosting, place temporary ini_set into index only if logs are unavailable, and remove it immediately.

An empty response can also come from output before headers and broken gzip in the panel, but that is rarer. First look for PHP Fatal.

Module conflict and ionCube

If a product or plugin requires ionCube/Zend Loader and the loader is missing, you will get a 500 with a clear log line. Do not confuse it with "just PHP 8". The package documentation says whether a loader is required. Most clean PHP scripts live without it, but client plugin collections vary.

open_basedir and paths

On shared hosting, open_basedir blocks access outside allowed directories. After migration, if config still contains old absolute paths such as /home/u123/old, file-open errors and 500 follow. Update paths or use relative paths as the product expects.

Locally on MicroServer, open_basedir usually does not interfere: local server.

Sessions

If PHP cannot create a session file, you get warnings/fatal errors and unstable login. session.save_path must exist and be writable by the PHP user. On some panels, the session path shifts after changing PHP version. Permissions overall: chmod.

How to distinguish Nginx from PHP

  • 502/504 with connect() failed in nginx means FPM, not script.
  • 500 with a PHP stack trace in the FPM log means script/modules/code.
  • 404 on all clean URLs while index.php works means rewrite.

About FPM: Nginx + PHP-FPM. About a database issue masked as 500: MySQL.

After updating PHP in the panel

Changed 8.1 to 8.3 with one button: restart FPM/web and check cron path to the new php. Some modules may not be enabled in the new version; gd may "disappear". Compare php -m with requirements: requirements.

If 500 started immediately after updating product files, roll back from backup and compare the diff: backup, update order: support and updates.

Minimum for a ticket

URL, request time with timezone, 5-20 log lines around the error, PHP version, and what changed last. This is enough to avoid twenty questions. SLA and timing expectations: SLA.

Sometimes 500 appears only on POST, such as saving a form or uploading a photo, while GET on the home page works. Then check request body limits, upload permissions, and the form handler, not the general claim "the site is down". The log will show this exact URI. For images, also check gd/imagick and php.ini limits from the requirements. On Nginx, check client_max_body_size separately: manual. If the error appears only after enabling https, mixed content rarely causes 500; a redirect loop is more common. But a broken absolute path in config after URL change does happen: SSL, URL migration: migration. Do not send a support ticket without a log line if you can get one: support.

FAQ

500 error after php script installation?

500 is almost always in error_log: PHP version, .htaccess, or database access.

How long does “500 Error After Script Installation” take?

About 6 minutes to read. In practice it depends on your hosting and database setup.

Do I need a dedicated server?

For most scripts, shared hosting or a VDS with PHP and MySQL is enough. See the VDS section and PHP/MySQL requirements.

How to install a php script on hosting?

See the related manual for this query. how to install a php script on hosting

Php mysql requirements for a script?

See the related manual for this query. php mysql requirements for a script

Section
Installing a PHP script

From server requirements to SSL and cron — every manual for launching a ready-made PHP script.