Skip to main content

PHP Installation Guide

This guide provides all the key information and getting-started instructions after a successful PHP installation via DeploySage-CLI, using the Remi repository for up-to-date versions.

Service Management (PHP-FPM)

Manage the PHP FastCGI Process Manager (FPM) service, which is essential for web server integration.

# Start the PHP-FPM service
sudo systemctl start php-fpm

# Stop the service
sudo systemctl stop php-fpm

# Restart the service
sudo systemctl restart php-fpm

# Check the service status
sudo systemctl status php-fpm

Key Configuration Files

Understanding the file structure is key to customizing your PHP environment.

ItemValue
Main PHP Config/etc/php.ini
PHP-FPM Main Config/etc/php-fpm.conf
PHP-FPM Pool Config/etc/php-fpm.d/www.conf
Extension Configs/etc/php.d/

Verification and Testing

Web Server Integration (Nginx)

Use these commands to verify your installation and check loaded modules.

After creating the file, you can access it at http://YOUR_SERVER_IP/info.php to see a detailed overview of your PHP configuration.

To process PHP files with Nginx, you need to add the following location block to your server configuration:

Remember to restart Nginx after modifying the configuration: sudo systemctl restart nginx.

# Check the installed PHP version
php -v

# List all loaded PHP modules
php -m

# Find the location of your php.ini file
php --ini

# Test your installation by creating a phpinfo() file
echo "<?php phpinfo(); ?>" | sudo tee /usr/share/nginx/html/info.php
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}