unable to install php7.4 using brew in macOs big usr
shoaib-125 opened this issue · comments
While installing the php7.4 using this command
brew tap shivammathur/php
faced the below error
Error: No available formula with the name "httpd" (dependency of shivammathur/php/phpà7.4).
==> Searching for a previously deleted formula (in the last month)...
Make sure you have the homebrew-core tap.
brew update
brew tap homebrew/core
Then install PHP.
Make sure you have the homebrew-core tap.
brew update brew tap homebrew/core
Then install PHP.
got this error on brew tap homebrew/core
Error: Tap homebrew/core remote mismatch.
https://github.com/Homebrew/brew != https://github.com/Homebrew/homebrew-core
Try this
HOMEBREW_DEVELOPER=1 brew untap homebrew/homebrew-core
brew tap homebrew/homebrew-core
Then install PHP
Try this
HOMEBREW_DEVELOPER=1 brew untap homebrew/homebrew-core brew tap homebrew/homebrew-core
Then install PHP
thanks this works.
now php is not overwriting when i run th overwrite command this happens
brew link --overwrite --force phpà7.4
Linking /usr/local/Cellar/phpà7.4/7.4.19... 25 symlinks created.
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/phpà7.4/bin:$PATH"' >> ¨/.zshrc
echo 'export PATH="/usr/local/opt/phpà7.4/sbin:$PATH"' >> ¨/.zshrc
===
could you please help me i am close i tried but still old php is there
This means PHP was installed and linked. Restart your terminal and then run php -v
to check PHP version.
You need to configure your webserver to use PHP 7.4 and restart its service.
To check the webserver you are using, search for $_SERVER['SERVER_SOFTWARE']
in your phpinfo
in the browser.
For apache
- open this file
/usr/local/etc/httpd/httpd.conf
- Find the line starting with
LoadModule php7_module
. - Change the PHP version in
LoadModule php7_module
line tophp@7.4
. - Restart apache
brew services restart httpd
For nginx
- Just reload
nginx
usingsudo nginx -s reload
Then check in the browser.