This script is designed to automate the migration of PHP-FPM configurations from an older version of PHP to a newer one, specifically targeting PHP 8.2 to PHP 8.3. It also updates corresponding Nginx site configurations to reference the new PHP-FPM version's socket paths.
- Migrates PHP-FPM pool configurations from PHP 8.2 to PHP 8.3. (or any applicable version)
- Updates Nginx site configurations to point to the new PHP-FPM sockets.
- Backs up original PHP-FPM and Nginx configurations before making changes.
- Provides options to migrate all configurations or specific ones.
- Excludes the default
www.conf
from migration unless explicitly included. - Restarts PHP-FPM and Nginx services to apply changes.
- The script is intended for use on Linux servers running PHP-FPM and Nginx.
- PHP 8.2 and PHP 8.3 should be installed on the system. (or any applicable version)
- Ensure you have sufficient permissions to modify PHP-FPM and Nginx configurations and restart their services (typically requires root or sudo privileges).
-
Make the Script Executable: ``` chmod +x migrate_php_fpm.sh ```
-
Run the Script: ``` ./migrate_php_fpm.sh ``` Follow the prompts to specify which PHP-FPM configurations to migrate.
-
Options for Specifying Configurations:
- The script creates backups of the original configuration files in `/tmp/backup-PHP-Migration_/`.
- Verify these backups before proceeding with any further changes.
- Test the script in a non-production environment before deploying it on live servers.
- Ensure the script handles your specific server setup and configurations.
- Feedback and contributions are welcome. Please feel free to submit issues or pull requests to the repository.
This script is released under the BSD license. For more details, see the LICENSE file in the repository.
The PHP-FPM & Nginx Configuration Migration Script is provided "as is" without warranty of any kind, either express or implied. Use of this script is at your own risk. While every effort has been made to ensure the script works as intended, the authors take no responsibility for any damages or loss incurred as a result of using the script.