Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading PHP to 7.1 / 7.2 #333

Open
jgraup opened this issue Aug 7, 2018 · 17 comments
Open

Upgrading PHP to 7.1 / 7.2 #333

jgraup opened this issue Aug 7, 2018 · 17 comments
Labels

Comments

@jgraup
Copy link
Contributor

jgraup commented Aug 7, 2018

Is there a preferred way to upgrade the environment to php 7.1 or php 7.2?

Currently php 7.0 is bundled with the box. According to http://php.net/supported-versions.php - 7.1 ends active support on Jan 1, 2019 which isn't terribly far away.

Thanks

@harkor
Copy link

harkor commented Aug 15, 2018

+1

If I update with apt-get install, use 7.2 instead of 7.0, restart apache, the mailcatcher doesn't work anymore.

@lzivadinovic
Copy link

lzivadinovic commented Nov 6, 2018

In our fork we use ppa:ondrej/php for supporting multiple php versions (for now we only need 5.6) and we use ansible to install php and enable required headers;

@harkor I guess that problem with 7.2 and mailcatcher is that there is no /etc/php/7.0/apache2/conf.d/99-vccw.ini file because file for 7.0 is provisioned trough ansible and there is custom sendmail_path = /usr/bin/env catchmail directive at the end of that file so i guess if you add that to 7.2 it should work (also switching to php7.2 mod in apache etc...);

@miya0001
Copy link
Member

@lzivadinovic

Thanks for your clarification.
We will update it. (I am very happy if you can send PR. 😊 )

@miya0001 miya0001 added the bug label Nov 14, 2018
@lzivadinovic
Copy link

@miya0001 Its not a problem for me to write pre-step where php version could be read from site.yml and box configured according to selected version. What i dont like in that approach is that user first downloads vccw box with already installed php7.0 (https://github.com/vccw-team/vccw-xenial64/blob/master/provision/playbook.yml#L62 ) and then modifies that installation. Also, i really dont see the point in using pre-packed box at all it kills modularity if you want to, for example, change php version. Also its just a hassle to update box when bento/ubuntu-16.04 box is updated, you could simply use ubuntu/xenial64\bionic64 as base and do a provisioning here (only downside i see there is longer up time, by i guess no more than 2 minutes :) ) But its your approach.

If its ok for you to change php version while provisioning later on (i.e. setting up php version in site.yml in this repo) i could send you PR and i would be glad to contribute to project. Proposed soluion is following:

  • Add new environmental variable for selecting desired version of php from ondrej
  • Install and reconfigure php with appropriate php.ini for that specific version of php
  • if version of php is left at standard php7.0 i could just skip initial php install/configure role

Tell me if you agree on proposed solution and ill send you a PR in few days.

@IanZea
Copy link

IanZea commented Sep 17, 2019

@lzivadinovic @miya0001 @harkor @jgraup

Guys, but how do we set what PHP to use in the default.yml ? before we hit vagrant reload --provision?

That's the place to set it right?

using this doesint work,
composers:

  • phpunit/phpunit:7.3
  • squizlabs/php_codesniffer:~2.0
  • wp-coding-standards/wpcs:*

it just makes version like this:
7.0.26-2+ubuntu16.04.1+deb.sury.org+2

Another question:
Also when i tried to do 'vagrant reload --provision' it deleted my database which was very unfortunate. Any idea how to update php to 7.3 without deleting the database?

@amaguri1505
Copy link

according to following article:
https://qiita.com/miya0001/items/2499917d7ec3bc905781

the solution is to execute following command on guest:

curl https://raw.githubusercontent.com/vccw-team/change-php-version/master/run.sh | bash -s -- 7.3

and create following file on "Vagrantfile" directory:

provision-post.sh

#! /usr/bin/env bash

set -ex

curl https://raw.githubusercontent.com/vccw-team/change-php-version/master/run.sh | bash -s -- 7.3

@tkc49
Copy link

tkc49 commented Jun 18, 2020

@harkor

If I update with apt-get install, use 7.2 instead of 7.0, restart apache, the mailcatcher doesn't work anymore.

You need to change the 'sendmail_path' as follows.
/etc/php/7.2/apache2/php.ini
sendmail_path = /usr/bin/env catchmail -f [email protected]
and
sudo service apache2 restart

@litone01
Copy link

according to following article:
https://qiita.com/miya0001/items/2499917d7ec3bc905781

the solution is to execute following command on guest:

curl https://raw.githubusercontent.com/vccw-team/change-php-version/master/run.sh | bash -s -- 7.3

and create following file on "Vagrantfile" directory:

provision-post.sh

#! /usr/bin/env bash

set -ex

curl https://raw.githubusercontent.com/vccw-team/change-php-version/master/run.sh | bash -s -- 7.3

Hi @amaguri1505 Just wondering if you know about what have happened to the Xdebug after updating the PHP. Because in my case, there is no Xdebug installed and I am having a hard time trying to figure out how to reconfigure the settings for it to work. If you have to know, do you mind sharing with me any helpful resources? Thank you!

@brianmdesigns
Copy link

I know this is old but I really need to figure out how to update php version so newer themes will run locally.

@litone01 in your post above you say to run that execute that curl command, from my vagrant dir?
then I create the provision-post.sh file in my vagrant directory as well? Then run vagrant provision?

Sorry a little new to vagrant boxes so I yu could over explain the answer I might be able to get it to work.

@litone01
Copy link

I know this is old but I really need to figure out how to update php version so newer themes will run locally.

@litone01 in your post above you say to run that execute that curl command, from my vagrant dir? then I create the provision-post.sh file in my vagrant directory as well? Then run vagrant provision?

Sorry a little new to vagrant boxes so I yu could over explain the answer I might be able to get it to work.

@brianmdesigns Nope it is not my post (I am just quoting the previous reply) :( It has been a long time and I have not been using PHP and wordpress for some time, so I cant really recall the solution I adapted at that time. Maybe you can use google translation and follow this link https://qiita.com/miya0001/items/2499917d7ec3bc905781, which is also from the discussion above.

@tkc49
Copy link

tkc49 commented Jan 26, 2022

@brianmdesigns

Do you want to use PHP versions?

@brianmdesigns
Copy link

brianmdesigns commented Jan 26, 2022 via email

@tkc49
Copy link

tkc49 commented Jan 26, 2022

@brianmdesigns
@litone01

The current version of VCCW does not seem to be able to upgrade PHP.
This is because the version of Ubuntu os is old.
I think we need to upgrade Ubuntu os.

@brianmdesigns
Copy link

brianmdesigns commented Jan 26, 2022 via email

@tkc49
Copy link

tkc49 commented Jan 28, 2022

@brianmdesigns

I have tried the following box files.
Unfortunately, if we change the box file, we will also need to change the playbook configuration files.
It will be a very big change and take time.

You can use PHP7.4 if you do the following.
The following tasks are installed PPA( Personal Package Archive ) at your own risk.

vagrant up
vagrant ssh
sudo add-apt-repository ppa:jczaplicki/xenial-php74-temp
sudo apt-get update
https://raw.githubusercontent.com/vccw-team/change-php-version/master/run.sh | bash -s -- 7.4

@brianmdesigns
Copy link

brianmdesigns commented Jan 28, 2022 via email

@tkc49
Copy link

tkc49 commented Jan 29, 2022

@brianmdesigns

it just seems like VCCW is going to be obsolete then
if the PHP version isnt updated.

Yes, I think so too.
And VCCW is running on the Virtualbox.
Virtualbox does not support Apple silicon Mac.
In order to continue using VCCW, someone needs to change from Virtualbox to Docker.

Currently it is not scheduled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants