JarJarBernie / jimmybox

Web developer box with multiple PHP Versions
42 stars 15 forks source link

alt tag

jimmybox 3.2: web developer box with multiple PHP versions

vagrant box for PHP Developers with IonCube Integration for professional web development. Works with Shopware and many other applications and frameworks such as Magento, Oxid 6.x, Wordpress, Typo3 or Laravel.

Quick Setup:

1) Get the latest Versions of Vagrant and Virtual Box

2) clone the latest version and run vagrant up

git clone https://github.com/JarJarBernie/jimmybox.git .
vagrant up

3) open 192.168.33.11 in your browser (default PHP Version is 8.1)

(IP can be changed in your Vagrantfile, the "public" directory is your document root)

Made for PHP professionals and E-Commerce developers

Laravel 8 ready

Oxid 6 ready

Shopware ready´

Wordpress ready

Features

MySQL Access

Switching PHP-Versions:

Jimmybox comes with preconfigured virtual hosts to use multiple PHP Versions from 5.6 to 8.1. Please just edit your local hosts file to use different PHP Versions.

Prepare your hosts file

# PHP 8.1
192.168.33.11  jimmy81.com

# PHP 8.0
192.168.33.11  jimmy80.com

# PHP 7.4
192.168.33.11  jimmy74.com

# PHP 7.3
192.168.33.11  jimmy73.com

# PHP 7.2
192.168.33.11  jimmy72.com

# PHP 7.1
192.168.33.11  jimmy71.com

# PHP 7.0
192.168.33.11  jimmy70.com

# PHP 5.6
192.168.33.11  jimmy56.com

open Jimmybox in your browser

Provisioning & custom hosts setup

You can use our provisioning template to setup your custom hosts.

  1. place your hosts.conf files in povisioning/hosts/ and edit them regarding to your needs
  2. open provisioning/setup/apache.sh and add code to enable/disable your custom hosts. This will ensure that your hosts only will be enabled if the directory exists.
  3. if needed, copy your SSL certs to provisioning/ssl/ and link it in your custom hosts config file
  4. restart vagrant with the provisioning flag and your vhosts will get enabled if the vhosts dir exists.
vagrant reload --provision

Switching PHP Versions in your custom hosts

Please include the following SetHandler directives in your custom vhost as seen in provisioning/hosts/100-myproject.conf. After that, you can simply uncomment the requested line and reload your apache config (sudo service apache2 reload)

<FilesMatch \.php>
        SetHandler "proxy:unix:/var/run/php/php8.1-fpm.sock|fcgi://localhost/"
        # SetHandler "proxy:unix:/var/run/php/php8.0-fpm.sock|fcgi://localhost/"
        # SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost/"
        # SetHandler "proxy:unix:/var/run/php/php7.3-fpm.sock|fcgi://localhost/"
        # SetHandler "proxy:unix:/var/run/php/php7.2-fpm.sock|fcgi://localhost/"
        # SetHandler "proxy:unix:/var/run/php/php7.1-fpm.sock|fcgi://localhost/"
        # SetHandler "proxy:unix:/var/run/php/php7.0-fpm.sock|fcgi://localhost/"
        # SetHandler "proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost/"
</FilesMatch>

Modify php.ini settings

Since Jimmybox 3.2 you can manage the php.ini settings from within the provisioning folder:

vagrant reload --provision

Upgrade

Upgrade from 3.x to 3.2

if you don't want to use vagrant box upgrade you can run vagrant reload --provision instead. This will run the commands in provisioning/setup/updates.sh and install the newest versions of

# uncomment this line in your Vagrantfile:
config.vm.provision "shell", path: "./provisioning/setup/updates.sh"
# prepare (Jimmybox must me running)
vagrant ssh
wget https://repo.mysql.com/mysql-apt-config_0.8.22-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb
sudo apt-get update
sudo apt-get upgrade

# if Jimmybox is running
vagrant reload --provision

# if Jimmybox is not running
vagrant up --provision

Upgrade from older version

Please do not use vagrant box update if you are using jimmybox < 3.0! Create a new version instead an migrate your data manually.


Known issues & fixes

MacOS Monterey Fixes (network and NFS share)

After upgrading to MacOS 12.x Vagrant stops working due to an issue with Virtual Box (6.1.30). Until the issue is fixed, please use the following workaround:

* 0.0.0.0/0 ::/0

Vagrant will also throw an error during startup concerning the NFS Share (nfs folders uninitialized constant error). You can fix this regarding to https://github.com/hashicorp/vagrant/issues/12583

sudo curl -o /opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/plugins/hosts/darwin/cap/path.rb \ 
 https://raw.githubusercontent.com/hashicorp/vagrant/42db2569e32a69e604634462b633bb14ca20709a/plugins/hosts/darwin/cap/path.rb 

NFS Share in MacOS 10.15 (Catalina) / MacOS 11 (Big Sur) / MacOS 12 (Monterey)

In Catalina (and sometimes Big Sur) NFS seems to have troubles finding a relative path in your synced folder. You can avoid this if you just use an absolute Path (/Volumes/...)

config.vm.synced_folder "/Volumes/Macintosh HD/Users/your-user/Sites", "/var/www", type: 'nfs', mount_options: ['rw', 'vers=3', 'tcp', 'fsc' ,'actimeo=1']

MySQL 5.7 strict SQL mode?

We have disabled the strict SQL mode for better compatibility with older apps. You can simply enable it doing this:

vagrant ssh
sudo rm /etc/mysql/conf.d/disable_strict_mode.cnf
sudo service mysql restart

Troubles with APCu?

In some cases, APCu can cause troubles. You can disable APCu using the following commands

vagrant ssh
sudo apt-get remove php-apcu
sudo service apache2 restart

ioncube loader for PHP 8.0 / PHP 8.1

by the date of the release the ioncube loader is not ready for PHP 8.0. We will implement this as soon if it's available.