All Questions
2,649
questions
690
votes
47
answers
477k
views
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac
I installed node using homebrew (Mojave), afterwards php stoped working and if I try to run php -v I get this error:
php -v
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib
...
320
votes
13
answers
559k
views
Where is PHP.ini in Mac OS X Lion?
I wanted to run some PHP right on my Mac, uncommented httpd.conf, activated web sharing, installed MySQL etc.
I can't seem to find my PHP files, most importantly, PHP.ini.
On my old machine it was ...
211
votes
20
answers
419k
views
How can I easily switch between PHP versions on Mac OSX?
I would like to test my application on PHP 5.3 up to PHP 8.2.
Where and how can I install the versions and how can I switch them by running a small script?
150
votes
10
answers
210k
views
How can I add additional PHP versions to MAMP
The current version of MAMP that I have only has php 5.2.17 and 5.4.4. I need 5.3.X. Is there a way to add additional versions that can be selected in the MAMP interfaces php preferences? This is for ...
127
votes
36
answers
313k
views
MySQL Database won't start in XAMPP Manager-osx
I downloaded XAMPP about a month ago and it was working just fine. Today I installed a voice recognition software and then restarted my computer. Ever since, MySQL won't start in my manager-osx ...
114
votes
19
answers
319k
views
mysqli_real_connect(): (HY000/2002): No such file or directory
mysqli_real_connect(): (HY000/2002): No such file or directory
PhpMyAdmin error on MacOS. I want answer I really have no idea what I need to do to resolve this.
110
votes
6
answers
102k
views
$PHP_AUTOCONF errors on mac os x 10.7.3 when trying to install pecl extensions
I am trying to setup my machine with pecl_http and memcache and in both cases, I get similar errors. This is on MAC OS X 10.7.3 (lion) and I also have XCODE installed on it. I also installed Zend ...
106
votes
15
answers
178k
views
Where does MAMP keep its php.ini?
I have recently got a mac an am not used to developing on a mac at all.
I have MAMP Pro 1.9.6.1. I did a locate on php.ini and got this:
$ locate php.ini
/Applications/MAMP/conf/php5.2/php.ini
/...
102
votes
13
answers
146k
views
How do I upgrade PHP in Mac OS X?
I feel this is an awfully obtuse question to ask, but strangely, this problem is poorly documented.
I would like to upgrade PHP, but there are several problems:
There is no built-in package ...
102
votes
12
answers
156k
views
Easiest way to activate PHP and MySQL on Mac OS 10.6 (Snow Leopard), 10.7 (Lion), 10.8 (Mountain Lion)?
What is the easiest way to activate PHP and MySQL on Mac OS 10.6 (Snow Leopard), 10.7 (Lion), 10.8 (Mountain Lion)?
I'd prefer to use any bundled versions before resorting to downloading from the PHP ...
99
votes
7
answers
156k
views
How to use the php that brew installed?
On my mac I've got php installed and working fine. I recently wanted to install mcrypt, so I did so using brew. Although it seemed to install fine, it doesn't show up in my phpinfo(). So I think that ...
94
votes
21
answers
155k
views
Mysql password expired. Can't connect
I just wiped my Mac and did a fresh install of El Capitan. I'm struggling to connect to Mysql now. Having gone through a web server setup process, I've created a simple PHP test file:
<?php
$...
88
votes
12
answers
125k
views
install ext-zip for Mac
I am trying to run composer update and I get the following errors:
Problem 1
- The requested PHP extension ext-zip * is missing from your system. Install or enable PHP's zip extension.
Problem ...
81
votes
10
answers
238k
views
Where is localhost folder located in Mac or Mac OS X?
I just started developing PHP projects on my mac (using PDT) and was wondering where localhost is located? How does Mac OS X serve websites, I haven't changed any settings during the installation of ...
72
votes
3
answers
38k
views
osx 10.10 Curl POST to HTTPS url gives SSLRead() error
I just recently upgraded to OSX 10.10 Yosemite and I since the upgrade I can't do Curl POST to a SSL url anymore.
I first used wordpress's wp_remote_request call and also tried to use curl in php.
...
70
votes
7
answers
117k
views
Update PHP to 7.4 macOS Catalina with brew
I try to update my PHP version to 7.4 on macOS Catalina with brew.
I did brew install [email protected]
If I check my version php -v, I still see the old version PHP 7.3.11?
What do I have to do?
Update:
After ...
69
votes
9
answers
139k
views
zsh: command not found: php
I have been using php with mamp on mac for a year even with old versions of MacOS, since I installed MacOS Monterrey if I type php on the terminal I get a message:zsh: command not found: php
Using ...
63
votes
8
answers
35k
views
Errors installing Composer on macOS (JIT compilation failed)
When I run composer --version in the macOS terminal, I get the following errors.
PHP Warning: preg_match(): JIT compilation failed: no more memory in
phar:///usr/local/bin/composer.phar/vendor/...
60
votes
13
answers
144k
views
How to override the path of PHP to use the MAMP path?
After screwing up entirely my PHP configuration on MAC trying to get the SOAP module working (-bash: /usr/bin/php: No such file or directory
....) I now have to use MAMP but each time I have to type ...
58
votes
10
answers
83k
views
Installing pecl and pear on OS X 10.11 El Capitan, macOS 10.12 Sierra, macOS 10.13 High Sierra (< 10.13.3)
So it looks like the new 'System Integrity Protection' lockdown of /usr (among other directories) makes pear and pecl a non-starter. Has anyone found a workaround short of disabling it?
56
votes
5
answers
82k
views
Start a PHP server on Mac OS X
I am figuring out how to use PHP OpenId
I have cloned the repo to the ~/www directory. There are some examples in the php-open-id/examples directory which I wanted to run.
Specifically, I wanted to ...
55
votes
4
answers
91k
views
How do you get php working on Mac OS X?
I have recently updated to Lion and enabled Web Sharing in the System Preferences but I am unable to get php working.
I added an info file to the web root directory and it outputs the file as text.
...
54
votes
12
answers
154k
views
Updating php version on mac
I want to update php version, currently I have 5.5.38 and I want 7.1
What I tried so far is using this command:
curl -s https://php-osx.liip.ch/install.sh | bash -s 7.1
I tried several different ...
50
votes
6
answers
59k
views
Wordpress localhost ftp
I have wordpress running on my localhost on mac Lion.
Everytime I try to install or delete plugins it asks me for hostname, ftp username and ftp password.
I configured my localhost to 127.0.0.1, but ...
49
votes
8
answers
71k
views
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing
Today I am trying to upgrade php on MacOS Mountain Lion. I followed MacTuts+ tutorial and on the step where I execute that long command:
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--...
49
votes
3
answers
51k
views
How can I get MAMP to tell me what went wrong with php code?
Whenever I have an error in my php code, MAMP just returns a 500 error. Is there anyway I can get MAMP to tell me what went wrong like parsing errors and stuff?
48
votes
2
answers
14k
views
php interactive shell doesn't have any output?
bash-3.2$ php -a
Interactive shell
php > $a = null || "hi"
php > echo $a
php > $b = "hi"
php > echo $b
As you can see here, nothing is being echoed.
Why is that?
I'm using Mac OS X lion. ...
47
votes
5
answers
60k
views
How to run a PHP script from the command line with MAMP?
I have MAMP installed. Now I am trying to run a script from the command line, but I can't seem to get it to work.
How should I set up my environment so that I can run a script from the command line ...
46
votes
3
answers
28k
views
How can I fix "Error: Formulae found in multiple taps"?
I want to install php54-redis.
Yu:nginx Yu$ brew install josegonzalez/php/php54-redis
==> Installing php54-redis from josegonzalez/homebrew-php
Error: Formulae found in multiple taps:
homebrew/...
44
votes
7
answers
114k
views
phpize reports "Cannot find config.m4"
I am trying to run the 'phpize' command on MacOSx Mountain Lion, but this is what I get:
Cannot find config.m4.
Make sure that you run '/opt/local/bin/phpize' in the top level source directory of ...
43
votes
3
answers
26k
views
MAMP time between seeing live changes
I'm using MAMP server and wondering why changes I make to the PHP files are not instantaneously displayed when I page refresh (in browser). Is there a way to set this up? There are no caching settings ...
41
votes
13
answers
86k
views
ImageMagick Brew installation with PHP Module in Mac OS X
I have installed ImageMagick using brew install imagemagick. This all worked fine and I can run any ImageMagick command from the Terminal / Command line.
Now when I try to use the ImageMagick classes ...
40
votes
16
answers
114k
views
Installing mcrypt extension for PHP on OSX Mountain Lion
Apologies in advance for the potential n00b questions, I am trying to install the mcrypt extension for PHP on my OSX Mountain Lion machine.
The following steps in terminal is what I have done so far ...
40
votes
7
answers
71k
views
Install phpredis MAC OSX
Can anyone help me install php-redis in MAC OSX .
brew install php-redis
not working.
pecl install php-redis
also not working getting -
invalid package name/package file "php-redis".
...
40
votes
3
answers
80k
views
How to change PHP version on MAMP 4.1
I downloaded MAMP 4.1 on my Mac; by default, the only PHP versions I can use are 7.0.15 and 7.1.1
How can I use PHP 5.6?
I tried the solution here Which says I should rename the versions I don't ...
39
votes
2
answers
45k
views
XAMPP 1.8.2-2 Apache Web Server won't start, always stops immediately
I'm running XAMPP 1.8.2-2 on my mac (OS X 10.9) and the Apache Web server won't start. It always get the status starting up.. or stopped. (never a green light.) I already tried to change the port to ...
39
votes
5
answers
116k
views
Installing PHP using Homebrew on Mac
I am trying to install PHP on my Mac machine using Homebrew.
I am using the following command:
brew install php
However, I am getting the following errors:
Error: No available formula with the name &...
37
votes
8
answers
90k
views
How To Install and Run wkhtmltopdf on Mac OsX 10.7.3 for use in a PHP Application
I've written a PHP/MySQL application that utilizes wkhtmltopdf to generate reports from data entered into the database. The client asked that I also install it to run as a standalone on a Mac that he ...
36
votes
19
answers
79k
views
CakePHP Database connection "Mysql" is missing, or could not be created
There have been several other posts about this, but none of the answers seemed to work for me.
When I navigate to the CakePHP page on my local machine, there is one error:
Cake is NOT able to ...
36
votes
13
answers
11k
views
Easiest way to simulate no free disk space situation?
I need to test my web app in a scenario where there’s no disk space remaining, i.e. I cannot write any more files. But I don’t want to fill my hard drive with junk just to make sure there’s really no ...
35
votes
7
answers
112k
views
How to enable the memcached PHP extension after installing with homebrew?
I recently installed memcached with homebrew, I'm not entirely sure how to enable it on my PHP envirionment since I added extension=memcached.so in /etc/php.ini in Lion OS X.
Even I restarted apache ...
34
votes
4
answers
49k
views
Can't phpize or configure an extension in OS X 10.9 Mavericks
I am trying to build the memcached extension on OS X 10.9 Mavericks for use with the built in PHP 5.4, initially I tried pecl install memcached but that threw the following.
checking for zlib ...
33
votes
10
answers
73k
views
Enabling PostgreSQL support in PHP on Mac OS X
I'm having a terribly difficult time getting the command "pg_connect()" to work properly on my Mac. I'm currently writing a PHP script (to be executed from console) to read a PostgreSQL database and ...
33
votes
5
answers
137k
views
pecl:command not found
I'm trying to run the following command in terminal on my macbook pro
cd /tmp; pecl download memcached
but im getting
pecl:command not found.
after a days googling I cant find out whats up. Does ...
32
votes
5
answers
60k
views
How to install gettext on MacOS X
How do I install gettext on mac?
I get this error on one of my php pages:
Fatal error: Call to undefined function bindtextdomain()
and it's because I don't have gettext installed.
I can't find ...
32
votes
2
answers
37k
views
How to install PHP 7.2 on macOS Big Sur using Homebrew?
I want to install PHP 7.2 on MacBook Pro M1, macOS Big Sur (11.5.2).
I already read an article (How To Install a PHP 7.2 on macOS 10.15 Catalina Using Homebrew and PECL), but it doesn't work for me.
I ...
32
votes
11
answers
41k
views
PHP7 installed by Homebrew doesn't work with Apache on macOS
I am trying to upgrade to php7 which I installed via homebrew.
In CLI php -v returns
PHP 7.0.10 (cli) (built: Aug 21 2016 19:14:33) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, ...
30
votes
3
answers
41k
views
phpize won't work on Mac OS X Lion
I try to install xdebug but I get the follow error message about 'phpize'.
How can I fix this thing?
leny:~ nick$ sudo pecl install xdebug
Password:
downloading xdebug-2.1.2.tgz ...
Starting to ...
30
votes
3
answers
56k
views
How to install Composer on macOS?
I was trying to install the Composer on my macOS version: high sierra--> 10.13.4
but after using the command:
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"...
30
votes
6
answers
20k
views
$PATH environment variable for apache2 on mac
I am trying to get apache/php to recognize the path to my git. I have been researching and looking in all corners of the web and cannot find how to do this. Basically, no matter what I try, when I run ...