PHP overview


PHP, (or PHP: Hypertext Preprocessor), 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:

  • User-installed PHP running as a CGI application
  • PHP 7 running as a CGI or FastCGI application
  • PHP 7 running as an Apache module (on DreamHost PS only)

DreamHost does not support mod_php on shared servers. For more information about mod_php, you can read more about on the DreamHost blog.

Default PHP version in the panel

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

This version of PHP may throw the following error 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?