Helper scripts for running PHP on Bluehost shared accounts.
This project has 3 components:
- Script launchers for PHP 5.4, 5.6, 7.0 (both php-cgi and php-cli) for Bluehost's shared hosting environement.
- php.ini files configured for php-cgi.
- php.ini files configured for php-cli.
- Log into your Bluehost cPanel and be sure you are running your desired version of PHP.
- Log into your Bluehost cPanel and make sure SSH access is turned on.
- Log into your Bluehost account through SSH:
- Create a directory where you want to install this project (recommendation is
~/opt/php). - Navigate to the install directory.
- Inside that directory, run (that last period is important):
git clone https://github.com/blueblazeassociates/php-on-bluehost . - For your version of PHP, copy the correct .ini file as follows:
- For CGI, copy
ini-cgi/phpXY.iniinto~/public_html, whereXYare the version numbers of your PHP version. The copied file should be namedphp.ini. There will probably already be aphp.inifile in~/public_html, go ahead and overwrite it. - For CLI, copy
ini-cli/phpXY.iniinto~/.php. You might need to create this directory. The copied file should be namedphpXY.ini, where XY is replaced with your version,php70.inifor example.
- For CGI, copy
- At this point, the following things should be true:
- You have downloaded the Git repository to
~/opt/php. - You have copied
ini-cgi/phpXY.ini(where XY = 54, 56, or 70) to~/public_html/php.ini. - You have copied
ini-cli/phpXY.ini(where XY = 54, 56, or 70) to~/.php/phpXY.ini. This file doesn't actually have XY in the name, but XY is replaced with your version,php70.inifor example. - You have edited a few settings as indicated in an above step.
- You have downloaded the Git repository to
- Create a
~/bindirectory if it doesn't exit. - Run the following commands:
chmod 744 ~/opt/php/php*ln -s ~/opt/php/phpXY ~/bin/phpwhere XY = 54, 56, or 70ln -s ~/opt/php/phpXY-cli ~/bin/php-cliwhere XY = 54, 56, or 70
- Create a directory where you want to install this project (recommendation is
Note: You may need to adjust your PATH variable to find the new ~/bin directory before finding Bluehost's default.
- Coming Soon
- I have to run these commands for every project I work on, so I placed them here for easy use.