I'm running FreeBSD 11.1 with its stock PHP 5.6.34, which is generally OK since all of my recent PHP code is written for PHP 5 (upgraded from PHP 4, and from PHP 3 before that). However, there are third-party packages such as Laravel that require PHP7, and I have some need/desire to work with such programs. Consequently, I'm trying to use php7mar to identify issues in my PHP code base that need to be resolved before changing to PHP7.
For its syntax checks,
I tried
and got a long list of errors about not being able to load PHP7 dynamic modules before the binary printed
Next I went to the php72-extensions directory and tried a similar
so I added to /etc/make.conf
but still got the same result when I tried to build the extensions.
So it seems that in order to build PHP7 and its extensions, PHP 5 has to be removed. Since this is a production server, I pretty obviously cannot do that! What I'm considering is setting up a jail, removing PHP 5 from the jail, and doing the PHP7 build there. Will that work? Can I remove PHP5 from the jail without deinstalling it in the root environment? Is there another way to do this, short of having another machine to build PHP7 on (which isn't an option at the moment)?
----
N.B.: I tried searching the forums for "make php7 without installing" and got a disclaimer at the top of the results saying
after doing the same search using "not" instead of "without" resulted in the "same" warning - "not" was excluded. In both cases, the word exclusion totally changed the meaning of the search, so the results were completely useless. I tried to find an answer here in the forums before asking this question...
For its syntax checks,
php7mar
needs a PHP7 binary to use for testing. However, one cannot have PHP5 and PHP7 installed on the same machine at the same time. My solution was to go into the ports tree and make
php72 without doing make install
. I had to comment out CONFLICTS= php56-*
in the Makefile to get it to build, and was concerned when it said it was installing when make
finished, but no damage was done. The port build gave me a binary in the working directory that I thought I'd be able to use for php7mar
using its --php="
option to specify the location of the CLI binary - but it still complained with
Code:
ERROR! Syntax checking was selected and a PHP binary lower than 7.0.0-dev was specified.
I tried
Code:
# /usr/ports/lang/php72/work/stage/usr/local/bin/php -r 'echo phpversion()."\n";'
7.2.3
.Next I went to the php72-extensions directory and tried a similar
make
there (including a Makefile edit to comment out IGNORE_WITH_PHP= 56
). That failed with
Code:
Unknown extension sodium for PHP 56.
Code:
DEFAULT_VERSIONS+= php=72
So it seems that in order to build PHP7 and its extensions, PHP 5 has to be removed. Since this is a production server, I pretty obviously cannot do that! What I'm considering is setting up a jail, removing PHP 5 from the jail, and doing the PHP7 build there. Will that work? Can I remove PHP5 from the jail without deinstalling it in the root environment? Is there another way to do this, short of having another machine to build PHP7 on (which isn't an option at the moment)?
----
N.B.: I tried searching the forums for "make php7 without installing" and got a disclaimer at the top of the results saying
The following words were not included in your search because they are too short, too long, or too common: without
after doing the same search using "not" instead of "without" resulted in the "same" warning - "not" was excluded. In both cases, the word exclusion totally changed the meaning of the search, so the results were completely useless. I tried to find an answer here in the forums before asking this question...