Skip to content

m1st0/php_ubuntu_build_script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Build Script for Ubuntu

php_build_ubuntu.sh
Automates building and installing PHP 8.x from source for testing on Ubuntu flavors with optional MySQL/MariaDB support and Apache integration.


🚀 About

This script compiles PHP 8.x by version choice from source, installs common extensions (mbstring, GD, curl, LDAP, etc.), and sets up MySQL or MariaDB support. It also configures Apache integration and handles alternative PHP paths.

Built and maintained by Maulik Mistry (m1st0) (original Gist)


✅ Features

  • Compile PHP 8 from source with popular extensions
  • Auto-detect MySQL vs. MariaDB
  • Apache module configuration and update-alternatives
  • Error-handling and environment setup
  • Color-coded script output for clarity

🛠️ Usage

  1. Clone the repo:
git clone https://github.com/yourusername/php-build-ubuntu.git
cd php-build-ubuntu
  1. Make executable:
chmod +x php_build_ubuntu.sh
  1. Run (may require sudo):
sudo ./php_build_ubuntu.sh
  1. Follow the prompts to select PHP version (default is 8.4.9) and confirm compilation options.
  2. You may change the default version by obtaining tags from the php-src repository or by checking out a version tag inside the php-src folder that the script creates on first run, and updating the PHP_VERSION variable accordingly.

📄 License

This project is licensed under the BSD-2-Clause license.
See LICENSE.txt for full details.


🙏 Support

If you find this script helpful, consider supporting me:

Lets keep each other going, safe, and well.

About

Builds PHP 8 on Ubuntu 26.04 with module support and optimized compilation. Includes MariaDB and MySQL compatibility.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages