E
E
EVMI2018-08-10 21:00:29
PHP
EVMI, 2018-08-10 21:00:29

Why doesn't php from brew work?

Apache 2.4 from the macos distribution, php 7.1.16 from the same distribution works fine.
But it is worth replacing php7_module in httpd.conf with the path from brew for php 7.1.20

/usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so

immediately stops loading pages, the server is not found.
Where to dig is not clear, on the command line php responds
php -v
PHP 7.1.20 (cli) (built: Jul 20 2018 10:27:12) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2018-08-10
@EVMI

my advice to you - never touch the system software.
put puff through the bru? Great. put the Indian through it too.
and, perhaps, it is worth abandoning it altogether in favor of other web servers.

A
Alexander Novikov, 2018-08-11
@AlexndrNovikov

In general, configuring Apache + PHP on a poppy with handles is not the best idea. I recommend building a setup on Vagrant (there you can build all the packages with pens in the usual Linux without the slightest adaptation in the usual style, and forward only the ports of interest to the outside and synchronize the folder with the code). Or go ahead and make a setup on the docker. A bonus is skill upgrade, environment encapsulation and unification for all developers (if there are more than one. Although it’s also more convenient for one, too)
Native Apache on a poppy interferes more than it brings benefits, especially if there are more than 1 projects :)
To switch php versions through brew, you can use https://github.com/philcook/brew-php-switcher
For minor versions like 7.1.16->7.1.20, of course, it won’t work, but it’s better to keep such things in a container/virtual machine, and for basic ones (like composer/phpcs/etc startup) it’s just right. As a bonus by default (not the most pleasant, as for me), this tool reloads the local apache with the specified PHP version

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question