I’m not sure if this is the right category for asking this question, but will give it a try.
I’m trying to setup a PHP environment following the instructions given in the book “Jump Start PHP Environment” by Bruno Skvorc.
I downloaded and installed: Vagrant, Virtualbox and Git.
At this point I am in the homestead_improved-master folder, running Git Bash and enter the command “bin/folderfix.sh” followed by “vagrant up” .
It downloaded the box but run into an error at the end:
==> default: Failed to restart php7.0-fpm.service: Unit php7.0-fpm.service not f ound. The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong.
I tried reloading it but the error persists:
$ vagrant reload --provision ==> default: Attempting graceful shutdown of VM… ==> default: Checking if box ‘laravel/homestead’ is up to date… ==> default: Clearing any previously set forwarded ports… ==> default: Clearing any previously set network interfaces… ==> default: Preparing network interfaces based on configuration…
_ default: Adapter 1: nat_
_ default: Adapter 2: hostonly_ ==> default: Forwarding ports…
_ default: 80 (guest) => 8000 (host) (adapter 1)_
_ default: 443 (guest) => 44300 (host) (adapter 1)_
_ default: 3306 (guest) => 33060 (host) (adapter 1)_
_ default: 5432 (guest) => 54320 (host) (adapter 1)_
_ default: 22 (guest) => 2222 (host) (adapter 1)_ ==> default: Running ‘pre-boot’ VM customizations… ==> default: Booting VM… ==> default: Waiting for machine to boot. This may take a few minutes…
_ default: SSH address: 127.0.0.1:2222_
_ default: SSH username: vagrant_
_ default: SSH auth method: private key_ ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM… ==> default: Setting hostname… ==> default: Configuring and enabling network interfaces… ==> default: Mounting shared folders…
_ default: /vagrant => C:/Users/mikek/Downloads/MKWP/homestead_improved-master_
_ default: /home/vagrant/Code => C:/Users/mikek/Downloads/MKWP/homestead_impro ved-master_ ==> default: Running provisioner: file… ==> default: Running provisioner: shell…
_ default: Running: C:/Users/mikek/AppData/Local/Temp/vagrant-shell20161224-98 04-1trjt88.sh_ ==> default: Running provisioner: shell…
_ default: Running: C:/Users/mikek/AppData/Local/Temp/vagrant-shell20161224-98 04-1hiyods.sh_ ==> default: Failed to restart php7.0-fpm.service: Unit php7.0-fpm.service not f ound. The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong.
And this is the reason why I dislike using 3rd party softwares. Instead of focusing on running your environment, you have to now focus on pleasing the 3rd party software so that it doesn’t break. I’d rather install them manually because this helps you understand which package broke and which didn’t. But you are actually in the right place. If you installed PHP manually (how I prefer it), you would of had a perfectly configured environment. But now you have a 3rd party to worry about. It might be the cause of breaking your environment. Nevertheless, if you are running a Linux partition, you probably won’t be learning anything Linux related because you’ll most likely be using something that is modified only to suit vagrant which I dislike. What’s the fun in running a Linux OS if you aren’t going to be using its commands?
So to properly install the missing piece. In “Linux”, you would do
sudo apt-get -y install php7.0-fpm
The -y flag simply just adds in yes to the installation so that you don’t get prompt questions when installing a package.
Highly doubt it’ll work though since you didn’t install it properly via the “Linux” commands which would of been using the command apt-get add-apt-repository and which would of been a much much much easier installation because you would be relying on NO 3rd party to install your environment.
But this probably won’t help at all. You could try using the Linux command, but I have no clue if it’ll help at all. Best of luck to you.
Thank you for your feedback spaceshiptrooper.
I am really new to this and hoped the book was a good start to a better work environment.
What would you recommend. Do you have a link or book that I shoud read?
I haven’t read the book, but from the sounds of it, it sounds like you need technical skills to have it up and running. I will be doing a written tutorial later today for people new to the whole thing. It’s a much easier way of installing PHP as well. The tutorial I am going to make only expects you to know a few things; how to update packages, how to install packages, and how to remove packages. Other than that, straight forward tutorial with minimum difficulties as we will be installing each individual package. This helps us decide which package needs more work. And if a package breaks, we won’t be relying on a 3rd party software to help fix it for us.
No. -fpm is only a Linux thing. It wouldn’t matter if your main host is Windows or Linux. Only the current host can effect it. It’s basically the service that starts up PHP. The equivalent to php7.0-fpm on Windows is php.exe. I remember messing around with -fpm once. The first time, I don’t know how I did it, but I broke -fpm. Luckily, it was on the live CD so not much work lost there since I could just restart my PC and try again. I think it had to do with configuring PHP with Apache wrong. The 2nd time, I was trying to uninstall PHP 5 and I uninstalled -fpm thinking I could replace that with PHP 7’s and having another way of upgrading. But I was wrong. Had to reinstall everything all over again.
Edit: @Ethannn I actually started writing the tutorial, but got half way and decided stop. I’ll finish up the tutorial tomorrow and post it on here.
Hey, turns out that it might actually take longer. For some odd reason, when you add the repository for PHP 7 to your system and you update your system and try to install PHP 7. It won’t work at all. Keeps saying
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0
E: Couldn't find any package by regex 'php7.0'
But then when you add the repository to your system, it reads like this.
Co-installable PHP versions: PHP 5.6, PHP 7.0, PHP 7.1 and most requested extensions are included.
PLEASE DON'T USE PHP 5.4 OR PHP 5.5. The PHP 5.5 and later are no longer supported with security updates, therefore they are not included in this repository.
You can get more information about the packages at https://deb.sury.org
BUGS&FEATURES: This PPA now has a issue tracker: https://deb.sury.org/#business
PLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly: https://donate.sury.org/
WARNING: add-apt-repository is broken with non-UTF-8 locales, see https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:
# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Press [ENTER] to continue or ctrl-c to cancel adding it
The installation for PHP on Windows is still the same, so I will be adding just that one into the topic since the one for Ubuntu seems to be broken.