{"id":2329,"date":"2017-06-17T05:21:02","date_gmt":"2017-06-17T05:21:02","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=2329"},"modified":"2019-07-29T03:33:06","modified_gmt":"2019-07-29T03:33:06","slug":"upgraded-php-on-sierra","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2017\/06\/17\/upgraded-php-on-sierra\/","title":{"rendered":"Upgraded PHP on Sierra"},"content":{"rendered":"<p>&lt;OLD&gt;<br \/>\nThe PHP version on my Sierra was 5.6. I want to upgrade it to PHP 7.0 version. I followed a tutorial from\u00a0<a href=\"https:\/\/coolestguidesontheplanet.com\/upgrade-php-on-osx\/\">https:\/\/coolestguidesontheplanet.com\/upgrade-php-on-osx\/<\/a>.<\/p>\n<pre class=\"lang:default decode:true\">curl -s http:\/\/php-osx.liip.ch\/install.sh | bash -s 7.0\r\n<\/pre>\n<p>PHP 7 would be installed in &#8216;\/usr\/local\/php5\/&#8217; directory. Actually this is a symlink directory from &#8216;\/usr\/local\/php5-7.0.18-20170506-095200\/&#8217; directory. Now I can use PHP 7.0 on my mac<a href=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/06\/phpinfo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2330\" src=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/06\/phpinfo-1024x218.png\" alt=\"\" width=\"840\" height=\"179\" srcset=\"https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/06\/phpinfo-1024x218.png 1024w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/06\/phpinfo-300x64.png 300w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/06\/phpinfo-768x164.png 768w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/06\/phpinfo-1200x256.png 1200w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2017\/06\/phpinfo.png 1886w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<p>But the php version on the terminal still show the old version. I need to change the $PATH like on this tutorial:\u00a0<a href=\"https:\/\/stackoverflow.com\/questions\/25731145\/mac-upgraded-php-to-5-6-but-cli-php-v-get-5-3-28\">https:\/\/stackoverflow.com\/questions\/25731145\/mac-upgraded-php-to-5-6-but-cli-php-v-get-5-3-28<\/a>:<br \/>\nOpen Terminal, then run<\/p>\n<pre class=\"lang:default decode:true\">open -a TextEdit ~\/.bash_profile<\/pre>\n<p>Then add these 2 lines at the bottom of the file:<\/p>\n<pre class=\"lang:default decode:true \">#PHP7\r\nexport PATH=\"\/usr\/local\/php5\/bin:$PATH\"<\/pre>\n<p>Save and reopen the terminal. Here is the new version:<\/p>\n<pre class=\"lang:default decode:true \">Xxxxx-MacBook-Pro:~ teddy$ php -v\r\nPHP 7.0.18 (cli) (built: May  6 2017 09:49:26) ( NTS )\r\nCopyright (c) 1997-2017 The PHP Group\r\nZend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies\r\n    with Zend OPcache v7.0.18, Copyright (c) 1999-2017, by Zend Technologies\r\n    with Xdebug v2.5.3, Copyright (c) 2002-2017, by Derick Rethans<\/pre>\n<p>&lt;\/OLD&gt;<br \/>\nNOW USE brew<br \/>\nREF: https:\/\/stackoverflow.com\/questions\/54207030\/what-are-the-options-to-upgrade-php-on-macos-mojave-10-14-2<br \/>\nSEARCH PHP<\/p>\n<pre class=\"lang:default decode:true \">Satrias-MacBook-Pro:~ teddy$ brew search php\r\n==&gt; Formulae\r\nbrew-php-switcher                                     phpunit\r\nphp                                                   homebrew\/linuxbrew-core\/brew-php-switcher\r\nphp-code-sniffer                                      homebrew\/linuxbrew-core\/php\r\nphp-cs-fixer                                          homebrew\/linuxbrew-core\/php-code-sniffer\r\nphp@5.6 \u2714                                             homebrew\/linuxbrew-core\/php-cs-fixer\r\nphp@7.1                                               homebrew\/linuxbrew-core\/php@5.6\r\nphp@7.2                                               homebrew\/linuxbrew-core\/php@7.1\r\nphplint                                               homebrew\/linuxbrew-core\/php@7.2\r\nphpmyadmin\r\n\r\n==&gt; Casks\r\neclipse-php                         netbeans-php                        phpstorm<\/pre>\n<p>INSTALL PHP 7.2<\/p>\n<pre class=\"lang:default decode:true \">Satrias-MacBook-Pro:~ teddy$ brew install php@7.2<\/pre>\n<p>START SERVICE<\/p>\n<pre class=\"lang:default decode:true \">Satrias-MacBook-Pro:~ teddy$ brew services start php@7.2\r\n==&gt; Successfully started `php@7.2` (label: homebrew.mxcl.php@7.2)<\/pre>\n<p>ADD PATH<\/p>\n<pre class=\"lang:default decode:true \">Satrias-MacBook-Pro:~ teddy$ echo 'export PATH=\"\/usr\/local\/opt\/php@7.2\/bin:$PATH\"' &gt;&gt; ~\/.bash_profile\r\nSatrias-MacBook-Pro:~ teddy$ echo 'export PATH=\"\/usr\/local\/opt\/php@7.2\/sbin:$PATH\"' &gt;&gt; ~\/.bash_profile<\/pre>\n<p>PHP.INI<\/p>\n<pre class=\"lang:default decode:true \">The php.ini and php-fpm.ini file can be found in:\r\n    \/usr\/local\/etc\/php\/7.2\/<\/pre>\n<p>MUST CLOSE THE TERMINAL THEN OPEN IT BACK TO CHECK THE PHP VERSION<\/p>\n<pre class=\"lang:default decode:true \">Satrias-MacBook-Pro:~ teddy$ php -v\r\nPHP 7.2.20 (cli) (built: Jul  5 2019 12:51:26) ( NTS )\r\nCopyright (c) 1997-2018 The PHP Group\r\nZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies\r\n    with Zend OPcache v7.2.20, Copyright (c) 1999-2018, by Zend Technologies<\/pre>\n<p>PHP-FPM<\/p>\n<pre class=\"lang:default decode:true \">Satrias-MacBook-Pro:html teddy$ php-fpm -v\r\nPHP 7.2.20 (fpm-fcgi) (built: Jul  5 2019 12:51:32)\r\nCopyright (c) 1997-2018 The PHP Group\r\nZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies\r\n    with Zend OPcache v7.2.20, Copyright (c) 1999-2018, by Zend Technologies<\/pre>\n<p>CHANGE PHP SETTING<\/p>\n<pre class=\"lang:default decode:true \">nano \/usr\/local\/etc\/php\/7.2\/php-fpm.d\/www.conf<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;OLD&gt; The PHP version on my Sierra was 5.6. I want to upgrade it to PHP 7.0 version. I followed a tutorial from\u00a0https:\/\/coolestguidesontheplanet.com\/upgrade-php-on-osx\/. curl -s http:\/\/php-osx.liip.ch\/install.sh | bash -s 7.0 PHP 7 would be installed in &#8216;\/usr\/local\/php5\/&#8217; directory. Actually this is a symlink directory from &#8216;\/usr\/local\/php5-7.0.18-20170506-095200\/&#8217; directory. Now I can use PHP 7.0 on my &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2017\/06\/17\/upgraded-php-on-sierra\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Upgraded PHP on Sierra&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,48],"tags":[],"class_list":["post-2329","post","type-post","status-publish","format-standard","hentry","category-macosx","category-php-2"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/2329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=2329"}],"version-history":[{"count":7,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/2329\/revisions"}],"predecessor-version":[{"id":2332,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/2329\/revisions\/2332"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=2329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=2329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=2329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}