Install and Configure PHP 7.1 on Cloud 9 Workspaces
Joe • July 6, 2017
community general linux php projects speaking ubuntuJuly 8th I'm giving a general PHP training day at the Fedex Institute of Technology and because I'm targeting absolute beginners I wanted to use Cloud 9. Cloud 9 is an online editor that gives you a full linux workspace to build your project in. The first thing I noticed was the container Cloud 9 provides is running PHP 5.5.
I've created a simple bash script to update PHP to 7.1 and update apache:
`install.sh`:
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -y
sudo apt-get install php7.1-curl php7.1-cli php7.1-dev php7.1-gd php7.1-intl php7.1-mcrypt php7.1-json php7.1-mysql php7.1-opcache php7.1-bcmath php7.1-mbstring php7.1-soap php7.1-xml php7.1-zip -y
sudo mv /etc/apache2/envvars /etc/apache2/envvars.bak
sudo apt-get remove libapache2-mod-php5 -y
sudo apt-get install libapache2-mod-php7.1 -y
sudo cp /etc/apache2/envvars.bak /etc/apache2/envvars
sudo a2dismod php5
sudo a2enmod php7.1
sudo service apache2
I've also added it to a Github Repo so you can clone that repo into a new workspace and you'll start the workspace with the script ready to run:
Once your workspace is ready, open the bash tab and run `sh install.sh`. When the command is complete, run your project and navigate to your project's URL and click on the info.php file. You should see similar output:
Hope this helped someone out or saved you some time. Thanks for reading.
As Seen On
Recent Posts
- PHP to Rust via Copilot
- Compiling Python 3.12 from Source Tarball on Linux
- HTML Form Processing with PHP - php[architect] Magazine August 2014
- The Workshop: Local Dev with Lando - php[architect] Magazine November 2022
- Getting back into the swing of things
- All Posts
Categories
- ansible
- apache
- applesilicon
- aws
- blackwidow
- cakephp
- community
- composer
- conferences
- copilot
- data-storage
- day-job
- devops
- docker
- fpv
- general
- github
- givecamp
- homestead
- jigsaw
- joindin
- keyboard
- laravel
- learning
- linux
- maker
- mamp
- mentoring
- music
- nonprofit
- opensource
- packages
- php
- phparch
- projects
- provisioning
- python
- razer
- rust
- s3
- security
- slimphp
- speaking
- static-sites
- storage
- testing
- tiny-whoop
- today-i-learned
- training
- ubuntu
- vagrant
- version-control
- windows
- writing
- wsl
- wsl2
- zend-zray