{"id":1187,"date":"2018-04-10T02:49:23","date_gmt":"2018-04-10T02:49:23","guid":{"rendered":"\/blog\/?p=1187"},"modified":"2018-05-15T22:56:46","modified_gmt":"2018-05-15T22:56:46","slug":"install-php-and-xdebug-in-macos-x","status":"publish","type":"post","link":"\/blog\/index.php\/install-php-and-xdebug-in-macos-x\/","title":{"rendered":"Install php and xdebug in macos x"},"content":{"rendered":"<p>For php56<\/p>\n<p>$ brew install php56 &#8211;with-httpd<br \/>\n$ brew install php56-xdebug<\/p>\n<p>If you wish to install php71 , you do not need to remove it, just install it, brew will remove php56<\/p>\n<p>$ brew install php71 &#8211;with-httpd &#8211;with-pear<br \/>\nTo enable PHP in Apache add the following to httpd.conf and restart Apache:<br \/>\n    LoadModule php7_module \/usr\/local\/opt\/php\/lib\/httpd\/modules\/libphp7.so<\/p>\n<p>    <FilesMatch .php$><br \/>\n        SetHandler application\/x-httpd-php<br \/>\n    <\/FilesMatch><\/p>\n<p>Finally, check DirectoryIndex includes index.php<br \/>\n    DirectoryIndex index.php index.html<\/p>\n<p>The php.ini and php-fpm.ini file can be found in:<br \/>\n    \/usr\/local\/etc\/php\/7.1\/<\/p>\n<p>For php 7.1 install xdebug using pecl<br \/>\n\/usr\/local\/Cellar\/php@7.1\/7.1.16\/bin\/pecl search xdebug<br \/>\n\/usr\/local\/Cellar\/php@7.1\/7.1.16\/bin\/pecl install xdebug<\/p>\n<p>xdebug config files are in:<br \/>\n\/usr\/local\/etc\/php\/5.6\/conf.d\/ext-xdebug.ini<br \/>\n\/usr\/local\/etc\/php\/7.1\/conf.d\/ext-xdebug.ini<\/p>\n<p>you don&#8217;t need to reinstall to switch in apache, just edit and restart<\/p>\n<p>vi \/usr\/local\/etc\/httpd\/httpd.conf<\/p>\n<p>and enable the line of the version you need:<br \/>\n#LoadModule php5_module \/usr\/local\/Cellar\/php56\/5.6.32_8\/libexec\/apache2\/libphp5.so<br \/>\nLoadModule php5_module \/usr\/local\/Cellar\/php56\/5.6.36\/lib\/httpd\/modules\/libphp5.so<\/p>\n<p>\/usr\/local\/bin\/apachectl -k restart<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For php56 $ brew install php56 &#8211;with-httpd $ brew install php56-xdebug If you wish to install php71 , you do not need to remove it, just install it, brew will remove php56 $ brew install php71 &#8211;with-httpd &#8211;with-pear To enable PHP in Apache add the following to httpd.conf and restart Apache: LoadModule php7_module \/usr\/local\/opt\/php\/lib\/httpd\/modules\/libphp7.so SetHandler [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1187","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1187"}],"version-history":[{"count":4,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1187\/revisions"}],"predecessor-version":[{"id":1191,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1187\/revisions\/1191"}],"wp:attachment":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1187"},{"taxonomy":"post_tag","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}