After some rework, this is what I came up with. I am not assuring that this is the right way to do this, just that, in my case, this works:
Find after.sh
that was created when setting up the estate . For me, on Mac El Capitain, the file is created in ~/.homestead/after.sh
, I think .bat
in a similar place on the windows.
Make no mistake editing ~/Homestead/src/stubs/after.sh
, this is the template file from the estate installation, and not the actual copy created.
Edit after.sh
Add the following lines to after.sh
(this is my entire file, only the first 5 lines of comments were in the default file):
#!/bin/sh
If you mentally do not know the exact name of sudo apt-cache search php7-*
you extensions (I did not know), you can use sudo apt-cache search php7-*
or similar to view the list of available
tramp destroy
Now, if you have a homestead, in the terminal, cd
to your Homestead directory, for me cd ~/Homestead
and then run vagrant destroy
roving up
While inside /Homestead
run vagrant up --provision
Check installation
To verify that the extensions are installed correctly, while inside /Homestead
run these two commands:
vagrant ssh
php -r "print_r(get_loaded_extensions());"
My conclusion (33 and 61 were added):
DoDSoftware:Homestead DOoDSoftware$ vagrant ssh Welcome to Ubuntu 16.04 LTS (GNU/Linux 4.4.0-22-generic x86_64) * Documentation: https://help.ubuntu.com/ vagrant@homestead :~$ php -r "print_r(get_loaded_extensions());" Array ( [0] => Core [1] => date [2] => libxml [3] => openssl [4] => pcre [5] => zlib [6] => filter [7] => hash [8] => pcntl [9] => Reflection [10] => SPL [11] => session [12] => standard [13] => mysqlnd [14] => PDO [15] => xml [16] => apcu [17] => apc [18] => bcmath [19] => calendar [20] => ctype [21] => curl [22] => dom [23] => mbstring [24] => fileinfo [25] => ftp [26] => gd [27] => gettext [28] => iconv [29] => igbinary [30] => imap [31] => intl [32] => json [33] => ldap [34] => exif [35] => mcrypt [36] => msgpack [37] => mysqli [38] => pdo_mysql [39] => pdo_pgsql [40] => pdo_sqlite [41] => pgsql [42] => Phar [43] => posix [44] => readline [45] => shmop [46] => SimpleXML [47] => soap [48] => sockets [49] => sqlite3 [50] => sysvmsg [51] => sysvsem [52] => sysvshm [53] => tokenizer [54] => wddx [55] => xmlreader [56] => xmlwriter [57] => xsl [58] => zip [59] => memcached [60] => blackfire [61] => Zend OPcache [62] => xdebug )
As I said at the beginning, I canβt say that this is the right way, but so far it works for me.
If someone sees a flaw in this approach, feel free to tell me that I'm doing everything wrong :)