What are these terms?
Apache is a web server. A web server is the program that hands your pages to visitors. CustomBuild is DirectAdmin's tool for installing and changing server software.
A PHP handler, or method, is the way Apache runs PHP code. Each method trades speed, safety and memory in a different way. Common ones are:
- mod_php runs PHP inside Apache. It is fast but all sites share one user.
- suPHP runs each site as its own user. It is safer but slower.
- PHP-FPM runs PHP as a separate service. It is fast and keeps users apart. Most servers choose it today.
- FastCGI is an older method that is similar to PHP-FPM.
Exact names depend on your CustomBuild version.
Before you start
Changing the method restarts Apache and rebuilds PHP. Sites may be slow or down for a few minutes. Take a snapshot or backup first. Also check that your sites do not depend on a specific method.
Steps in the panel
- Log in to DirectAdmin as admin.
- Open CustomBuild. Look under Server Manager or the admin menu.
- Find the Web Server setting. Make sure Apache is selected.
- Find the PHP mode setting. It has a name like PHP 1 Mode. Each PHP version has its own mode.
- Pick the method you want, for example php-fpm.
- Click Save.
- Click the button to rebuild PHP, then the button to rebuild Apache if the page asks for it.
- Wait until the log says it has finished.
Steps over SSH
SSH is a safe way to type commands on a server from far away.
- Connect as root.
- Go to the CustomBuild folder:
cd /usr/local/directadmin/custombuild
This moves you to the CustomBuild folder.
- Open the options file with a text editor and set your values, such as
php1_mode=php-fpm. - Rebuild PHP and Apache:
./build set php1_mode php-fpm
./build php n
./build apache
The first line saves the setting. The next two rebuild PHP and Apache.
After the change
- Open a few sites and check that they load.
- Test a form or a login page.
- If something breaks, set the old method again and rebuild.
Quick recap
- A PHP method decides how Apache runs PHP.
- PHP-FPM is a common, safe, fast choice.
- Set the mode in CustomBuild, then rebuild.
- Take a snapshot first.
- Test your sites after the rebuild.