PHP overview


PHP is a general-purpose server-side scripting language. It can be embedded within or used to manipulate HTML pages.

An example of PHP

A file with the following text that is saved with a file extension of .php, outputs "Hello, world!" when opened with a web browser:

echo "Hello, world!";

PHP on DreamHost

General requirements for using PHP at DreamHost

DreamHost currently allows the following PHP configurations:

  • PHP 7 and 8 running as a CGI or FastCGI application

Default PHP version in the panel

When you add a new domain in your panel, PHP 7.4 is selected by default.

If you choose to run PHP 7.3, the following error may appear on your site.

  • JIT compilation failed: no more memory errors

This is a bug with PCRE which you can read about here:

To work around this bug, DreamHost automatically adds the following lines to your site's phprc file.

pcre.jit = 0

This setting accommodates the majority of all PHP websites. However, if you specifically need this enabled, you can adjust the setting to the value of 1 in your phprc file.

Advanced topics

Changing the output buffer cache

If you are using PHP FastCGI, the PHP functions flush(), ob_flush(), and ob_implicit_flush() will not function as expected. By default, output is buffered at a higher level than PHP (specifically, by the Apache module mod_deflate which is similar in form/function to mod_gzip).

If you need unbuffered output, you must either use CGI (instead of FastCGI) or contact support to request that mod_deflate is disabled for your site.

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?