Upgraded to OSX Catalina and am having trouble installing libsodium for PHP. I have followed these steps Installation of Xdebug on MacOS Catalina 10.15 and still no joy.
When I run the php -i | grep "xdebug support" cmd I get the following error:
Failed loading /usr/local/php/extensions/xdebug.so:
dlopen(/usr/local/php/extensions/xdebug.so, 0x0009):
symbol '_xdebug_globals' not found, expected in flat namespace by'/usr/local/php/extensions/xdebug.so'
Any thoughts? thank you.
I was able to make it work by following the instructions at this site
https://profilingviewer.com/installing-xdebug-on-catalina.html
The solution on the site above is more detailed in the php-config portion. I believe the previous solution still works, but this one does not require you to turn SIP off.
Related
So I have just cloned a Contao based project on my Mac, and as I am setting it up i ran ´composer install´, before I updated to macOSX Catalina i never have this issue but now I am getting the following error, any ideas on fixing this? I am lost!
As the error message already says, the PHP intl extension is not enabled for the PHP CLI environment that you used.
If you used the system's PHP and Apache packages, your previous configuration might have been deleted/overridden by the MacOS update. This is known to happen.
I had the same problem and i solve it by reinstalling the command line tools
open your Terminal
write the command below
$ xcode-select --install
so how i solve it
I'm using Mojave OS X and I've been following these steps to install Xdebug through Pecl. I'm trying to set it up so I can use the debugger of PHPStorm.
http://www.devinbaldwin.com/2018/09/27/how-to-install-xdebug-on-a-new-mac-including-mojave/
This is my current setup:
Xdebug installed: no
Server API: Command Line Interface
Windows: no
Zend Server: no
PHP Version: 7.3.6
Zend API nr: 320180731
PHP API nr: 20180731
Debug Build: no
Thread Safe Build: no
OPcache Loaded: yes
Configuration File Path: /usr/local/etc/php/7.3
Configuration File: /usr/local/etc/php/7.3/php.ini
Extensions directory: /usr/local/lib/php/pecl/20180731
I've followed all the steps but got stuck at installing Xdebug because I didn't have phpize.
I've installed the newest version of Xcode to create phpize, this worked at first, but I was having trouble appending the php.ini through PHPStorm because the file was read-only and I've thought of following another guide which talks about downgrading PHP to version 7.2 and installing Xdebug through that version, which is how this problem started.
When I tried to install Xdebug through Pecl, I've got this error.
downloading xdebug-2.7.2.tgz ...
Starting to download xdebug-2.7.2.tgz (230,987 bytes)
.................................................done: 230,987 bytes
69 source files, building
running: phpize7.2
sh: phpize7.2: command not found
ERROR: 'phpize' failed
At the sh, it never showed phpize7.2 before, it used to show phpize without the numbers.
I've tried to uninstall and reinstall homebrew and remove all php versions and installed the current php version as posted above.
I just want to know how I can revert phpsize to the current version. I've tried using PHP 7.2 but I still got the same error.
I've tried this guide since I'm using the latest PHP version, which is 7.3.
https://sys.cuquejo.org/install-php-7-3-xdebug-on-macos-mojave-with-homebrew/
But I still get the same error.
In addition, when I typed phpsize I got this:
Cannot find config.m4.
Make sure that you run '/usr/local/bin/phpize' in the top level
source directory of the module
However, when I typed phpsize --help
Usage: /usr/local/bin/phpize [--clean|--help|--version|-v]
Typing phpize72 --help would only show this:
-bash: phpize7.2: command not found
I'm not sure why this happened but any explanations could help.
I followed the instructions outlined here:
Install PHP Internationalization extension (Intl) on XAMPP on Mac
Ran sudo pecl install intl
selected the correct files from the Cellar
then this error happened:
/private/tmp/pear/temp/intl/intl_error.h:24:10: fatal error:
'ext/standard/php_smart_str.h' file not found
include
^ 1 error generated. make: *** [php_intl.lo] Error 1 ERROR: `make' failed
No matter, did some research and found out that PHP 7.0.8 deprecated php.smart_str.h to php.smart_string.h
So given my scant knowledge of C++ I copied smart_string.h to smart_str.h and renamed all the headers from STRING to string.....
re-ran pecl -no luck....more errors......without knowing where the .c files are and remaking php (not really interested in going that far) since anyway I'm using XAMPP so that ended that option.
I have php 5.5 on my mac, deep in the usr/local/bin folder
so next step was to get pecl to use those files and generate an intl.so file....
Did that....I have the intl.so file so put it in the 'extensions' folder in XAMPP (for reference: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012)
Ran php and came up with this error:
Warning: PHP Startup: Unable to load dynamic library
'/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so'
- dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so,
9): Symbol not found: _zval_used_for_init Referenced from:
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
Expected in: flat namespace in
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
in Unknown on line 0
I imagine it has to do with different versions?
In any case I can't get pecl to install intl without a make error in PHP 7.0.8 on XAMPP. There is no documentation on this and you'd think that if you deprecate a header.h file you'd update all extensions?
Install intl.so in PHP 7 seems impossible?
After a lot of research I was finally able to resolve this. Detailed steps here:
before you begin, check which php path is set. it should be /Applications/XAMPP/xamppfiles/bin/php. If not you can change it by PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}". more detail here
Overall idea is to build the intl-extension from PHP source code on your own. Before you begin make sure you have installed Xcode. Also, install the latest version of autoconf. this might help:
brew install autoconf
Next download the version of PHP you use in XAMPP from php.net. I am using 7.1.18. This version worked for me: php-7.1.31, I’m guessing if you follow the steps it might work for 7.0 or 7.2 as well. Do let me know if it does or doesnt, I’ll update this post. Do not use PHP 7.3 for Magento 2.3.0, it is not supported.
Extract the tar.gz file using (I extracted it inside ~/Downloads/ folder )
tar -xzvf php-7.1.31.tar.gz
cd into the extracted folder
cd php-7.1.31
change to subfolder ext/intl
cd ext/intl/
Run these commands to build the extension
/Applications/XAMPP/bin/phpize
./configure --enable-intl --with-php-config=/Applications/XAMPP/bin/php-config --with-icu-dir=/Applications/XAMPP/xamppfiles/
make
sudo make install
you can now delete all files you downloaded and also the extracted folders.
Open /Applications/XAMPP/xamppfiles/etc/php.ini , and add extension=intl.so
Restart your Apache using XAMPP GUI and it should work.
So far, it seems that extension intl.so for php is bundled with php
and should be compiled with php (intl --enabled). XAMPP does not support this (as of Oct 2016), MAMP does. I do not know about other distros. However, if you're willing to recompile PHP 7, it's worth it just to do that and enable it during compiling.
So....I ran with MAMP. Then I decided that I would simply install apache 2.4 and php 7 and Mysql without the stack and the junk that comes with MAMP or XAMPP and everything works like a charm... so if you need to use CakePHP or intl support etc... just drop XAMPP/MAMP and go with a standard install. I used homebrew (MacOS) and everything is working fine.
Update: As regards Windows, XAMPP does not default it, but you can add the module (dll) in php.ini and works like a charm
The error means that XAMPP doesn't have PHP compiled with intl. You may try:
pecl install intl
but probably it won't work as well.
See: PHP Bug #72879 Pecl install intl make error with PHP 7.0.8.
As for the workaround, try installing memcached extension instead of memcache, e.g.
pecl install memcached
Note: It also requires libmemcached package/library to be installed beforehand. For macOS, install via: brew install libmemcached.
If you wanna try without homebrew, with native apache and php, look at my aswer here: https://stackoverflow.com/a/55131868/3692846
I'm following the KB Parallels upgrade instructions to upgrade PHP 5.3 to 5.4 on a CentOS5.10 machine
http://kb.parallels.com/en/115833 .
Step one advises to open the Autoupdater and check that PHP5 is selected. In my case, PHP5.3 is selected. I un-check PHP5.3 and check PHP5 then update changes. At this point, Plesk errors with the following:
Can't find solution for 'obsolete_mode_solution for php53-cli' of dummy_masterpackage_for_dependency-1.2.3.
I searched around and found a forum thread where the following two commands are recommended:
rpm -e php53-cli-5.3.3-5.el5 --nodeps
rpm -e php53-5.3.3-5.el5 --nodeps
These packages are not found and the above command returns the following error:
error: package php53-cli-5.3.3-5.el5 is not installed
error: package php53-5.3.3-5.el5 is not installed
All advice greatly appreciated.
Correct solution found on the lower section of the following page
http://kb.parallels.com/en/115833
I get this error when i try to run following command
sudo pecl install mongo
Error:
...php_mongo.c:22:10: fatal error: 'php.h'
file not found
#include <php.h>
^
1 error generated.
make: *** [php_mongo.lo] Error 1
ERROR: `make' failed
I am new to MAC, please help me to resolve this and get Mongo Working with PHP.
I have installed MacPorts and autoconf
It seems, that you did not install the xampp "Developer Package", required to build additional php extension. You can download the "Developer Package" from:
http://www.apachefriends.org/en/xampp-macosx.html#849
This has already been answered.
Please follow the processes outlined in this answer - Install PECL on Mac OS X 10.6.
I followed the process outlined here http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-7-lion/, referenced by the above Stackoverflow link and the process for install pear, followed by pecl and subsequently -
sudo pecl install mongo
works perfectly on OSX Lion.
You may need to modify the extensions in /etc/php.ini, however, this is explained in the output after you install the php mongo driver.
It took me the whole day to find this answer, I had tried everything, but this worked finally:
sudo C_INCLUDE_PATH=/usr/local/opt/openssl/include /Applications/XAMPP/xamppfiles/bin/pecl install mongodb
I found this article very helpful. Saved a lot of time after I wasted a lot of time to check other links. I did for MAMP and think will work for XAMPP too.
The thing is MAMP does not ship with all PHP sources to compile pecl mongo file and create mongo.so. All what you need is download php for respective version you are using. I was using php version 5.6.10. I checked php.net site that was having 5.6.13 version. I downloaded sources for this version from PhP.net. Executed "sudo pecl install mongo" again and it worked.