Dumb question I think, but I have PHP 5.6.14 running on El Capitan.
I have installed xdebug with
brew install php56-xdebug
But there is no mention of xdebug in phpinfo
phpinfo reveals:
Configuration File (php.ini) Path: /etc
When I run brew install php56-xdebug again, I get
homebrew/php/php56-xdebug-2.3.3 already installed
So I'm guessing that brew has installed xdebug on a path (where?) which is for a different version of PHP which I'm not actually running.
Can somebody help me understand what brew has done, and how I can configure the version of PHP that I'm running to include xdebug.
OK, so I fixed this. Any comments welcome on whether I did it right.
1) Found where the brew install of php is using
brew info php56
This reports:
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
Update version of php loaded by apache:
sudo nano /etc/apache2/httpd.conf
Replaced
LoadModule php5_module libexec/apache2/libphp5.so
with
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
For those who use different version of php type in terminal
--> brew search xdebug
and choose yours version.
after installing your version of xdebug you've to active it by placing the installed extension path to your php.ini file.
print your phpinfo() and look for "Loaded Configuration File".
Open the file shown for "Loaded Configuration File" ( mine is /etc/php.ini ) and paste extension path anywhere you like.
for me the xdebug installed extension path is "/usr/local/Cellar/php56-xdebug/2.5.1/xdebug.so"
so i pasted {zend_extension="/usr/local/Cellar/php56-xdebug/2.5.1/xdebug.so"}.
restart your apache server and check your phpinfo() for xdebug, thats all.
Related
I am trying to make postgresql work with apache on my Mac OSX. I use homebrew to manage all my dev features, so I replace the default php version provided by apache and download a homebrew version, this part works really fine. The problem is when I want to install the postgresql extension..
I have done this :
brew install postgresql
brew install php55 --with-postgresql
brew install php55-pdo-pgsql
And then edit the /etc/apache2/httpd.conf file to replace LoadModule php5_module libexec/apache2/libphp5.so by LoadModule php5_module /usr/local/opt/php55/libexec/apache2/libphp5.so.
Then when I exec the phpinfo() command, I can't see the postgresql extension installed in the PDO section. I only have this :
If anyone can help ;) Thank you all !
Possible solution :
- First install all packets like this : brew install postgresql php55 php55-pdo-pgsql
- Then brew reinstall php55 --with-postgresql
And it works.. I did this before (maybe not the same order) and it didn't work, I do not know why it works now !
Solution
When you watch the phpinfo() result, you should see something something like Loaded Configuration File and *Scan this dir for additional .ini files *. The thing is there is a global php.ini file and a .ini file per extension you install.
The value for *Scan this dir for additional .ini files * is where the .ini file for the extension must be located. So just need to create a ext-pdo_pgsql.ini and load the extension with extension="path to your/pdo_pgsql.so" (mine was /usr/local/opt/php55-pdo-pgsql/pdo_pgsql.so).
And for the installation just need brew install php55 php55-pdo-pgsql postgresql
Run php -m | grep pgsql to know if pgsql exists
Follow the example in this answer. Jump to note if you have a problem with the instruction there corresponding to number 4 here.
Enter ./configure --with-pdo-pgsql="path to postgres" and return. Mine is at "/usr/local/bin".
Enter make && sudo make install and return.
Add the extension to php.ini with sudo echo "extension=pdo_pgsql.so" >> path to php.ini. Find the path using php -i | grep php.ini
That should install pdo driver for postgres
Note
It is possible that sudo make install doesn't work. It might be due to an OSX feature known as csrutil. Reboot your machine and hold down cmd + R. From the recovery inteface run csrutil disable from terminal.
Reboot again and perform the make install. Repeat same process as in the paragraph above to enable csrutil by running csrutil enable at the recovery interface's terminal.
I have php5.6 on yosemite via brew running on Apache, but yet my phpinfo file shows php5.5
I have updated the /private/etc/apache2/httpd.conf file load module to:
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
I have restarted apache. I have restarted the terminal after adding both:
export PATH="/usr/local/opt/php56/bin/:/usr/local/sbin:/usr/local/bin:$PATH"
export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"
which php returns
/usr/local/opt/php56/bin/php
I have restarted the entire computer and when running a phpinfo file returns
PHP Version 5.5.20
I installed Homebrew and decided to upgrade php version to 5.5. Make it through the command:
brew install php55
All went well, and then I ordered a .bash_profile:
export PATH="$(brew --prefix homebrew/php/php55)/bin:/usr/local/bin:$PATH"
Next in the directory /Library/WebServer/Documents/ I created info.php file:
<?php phpinfo(); ?>
And opened it through the browser, but display the old version of php 5.4.30. How to enable php5.5 or delete old version php5.4.30? Help me!
I solved the problem, in the Apache configuration file nttpd.conf was need to set the path to the new version of php:
#LoadModule php5_module libexec/apache2/libphp5.so
LoadModule php5_module /usr/local/Cellar/php55/5.5.19/libexec/apache2/libphp5.so
I have Apache server on Mac OS 10.8. I need module IMAP to be enabled in PHP. I followed this instruction http://blog.xeonxai.com/2009/12/03/160/. I have installed imap.so and link it in php.ini file like this
extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/imap.so
But I cannot get IMAP modules when print out phpinfo() as well as imap_open function. What's wrong with my web server ?
Thanks for helping !
This is what I did to have the IMAP module working:
Install php56 with IMAP enabled using brew: brew install php56 --with-imap
Edit http.conf and replace the line loading PHP (LoadModule php5_module libexec/apache2/libphp5.so) with the newly installed PHP: LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
Restart apache: sudo apachectl restart
I am using mac 10.8 and I have installed php 5.5. At command line php -v show version 5.5. but when I starts mac's apache server with phpinfo(), it show version 5.4.
Can anyone please help me how to make apache to use version 5.5
Thanks
find out the conf/httpd.conf and conf.d/*.conf
find the tag like this: LoadModule php5_module modules/libphp5.so
make the change to correct php installation folder like this:
LoadModule php5_module /usr/local/Cellar/php54/5.4.8/libexec/apache2/libphp5.so
This will change your php model (php version) in Apache
Search on your local desk: find / -name "libphp5.so"
Regarding the correct so file: libphp5.so not being created after compiling and prefix directory not created
[update]
http://www.howtoforge.com/centos-5.6-php53-common-conflicts-with-php-common
1) update yum to include latest php
2)
For 64bit systems, you can find the correct packages here: http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/
For 32bit systems, the correct packages are here: http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/
3)
(replace to the correct URL and file name which you want to have, check it from step "2)")
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-11.ius.el5.noarch.rpm
4) rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
rpm --import /etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY
5) yum install yum-plugin-replace
6)
You can now replace your PHP old version packages with the PHP new version packages from IUS like this:
yum replace php --replace-with php55w
You can search for further php55w packages like this:
yum search php53u
If you uncommented the line LoadModule php5_module /usr/local/php5/libphp5.so in httpd.conf comment it again, then add the line export PATH=~/bin:/usr/local/php5/bin:$PATH in .bash_profile
This did the trick for me. Note: i have installed php5.5.5 via liip on OS X Mavericks