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:
<?php 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
PHP category links
- General PHP articles
- Updating PHP articles
- PHP directive articles
- PHP extension articles
- Installing PHP applications articles
- PHP troubleshooting articles
- Advanced PHP articles
- Custom PHP configuration articles
- Default PHP settings at DreamHost
Internal links
- php.ini overview
- How do I change the PHP version of my site?
- Viewing your site's PHP version and settings
- What versions of PHP are available at DreamHost?
- Command line PHP overview
- How do I change the PHP version my shell uses?
- Cannot modify header information
- Where can I view PHP errors and warnings?
- How do I enable PHP error logging?
- How do I increase the PHP memory limit?
- How do I increase the PHP upload limit?
- How do I install PEAR?
PHP mail articles
External links
- PHP Tutorials – Beginner PHP tutorials.
- PHP Documentation – All the information you could ever need.