Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. Set up PHP 7.2 on macOS Mojave (with homebrew)
  2. ==============================================
  3.  
  4.  less than 1 minute read
  5.  
  6. To check the version of PHP in the terminal, type the following command:
  7.  
  8. ```
  9. php -v
  10.  
  11. ```
  12.  
  13. or can see what versions of PHP are installed with 
  14.  
  15. ```
  16. brew list | grep php
  17.  
  18. ```
  19.  
  20. Maybe it's worth cleaning up some of the old packages from brew. It's up to you.
  21.  
  22. Make sure brew is up to date:
  23.  
  24. ```
  25. brew update
  26. brew upgrade
  27.  
  28. ```
  29.  
  30. Let's finally install 7.2 version of PHP
  31.  
  32. ```
  33. brew install php@7.2
  34.  
  35. ```
  36.  
  37. If you need to have this version of PHP first in your `PATH` run the following command:
  38.  
  39. ```
  40. echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile
  41. echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile
  42. source ~/.bash_profile
  43.  
  44. ```
  45.  
  46. And the result?
  47.  
  48. ```
  49. php --version
  50.  
  51. ```
  52.  
  53. Where is a php.ini file?
  54.  
  55. Your .ini file is located in `/usr/local/etc/php/7.2/php.ini`. To check just type
  56.  
  57. ```
  58. php --ini
  59.  
  60. ```
  61.  
  62. How to install extensions?
  63.  
  64. PHP extensions have been removed and now should be installed from `PECL`:
  65.  
  66. ```
  67. pecl install xdebug
  68. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement