Getting dyId: Symbol not found while checking the php version - php

I brew installed the php#7.2 and now I restarted the php but I am not able to start the service. I tried checking php version using php -v and I am getting the following error:
php -v
dyld: Symbol not found: __ZNK6icu_698Calendar3getE19UCalendarDateFieldsR10UErrorCode
Referenced from: /usr/local/Cellar/php#7.2/7.2.34_4/bin/php
Expected in: /usr/local/opt/icu4c/lib/libicui18n.69.dylib
in /usr/local/Cellar/php#7.2/7.2.34_4/bin/php
Can someone help me resolve this? I have spent numerous hours in this setup and installed and reinstalled php and everything still getting the same error. I tried cleaning everything up and doing the fresh installation but still I couldnot run it successfully.

Related

Manual configuration of Xcode

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.

Can't open PHP, dyld: Library not loaded

I am aware there are many other questions related to this error, but I have tried all the answers and nothing worked.
Full error
dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
Referenced from: /usr/local/opt/php#7.1/bin/php
Reason: image not found
Abort trap: 6
When did the error occur?
Right after updating Ruby to 2.6.3 via RVM.
Whenever I enter "php" into the terminal the error appears.
Steps taken
Basic steps: Restart Macbook, opened new terminal window.
Uninstall/Reinstall: Node, Openssl, libpng, Ruby
Update/Upgrade: brew
Unlinked/Linked: libidn, autoconf
Given myself all rights via chown -R /usr/local
OpenSSL: $ sudo rm /usr/bin/openssl, brew reinstall openssl#1.1
Brew cleanup
Reinstalled PHP
Versions
Mac OS Mojave 10.14.6
PHP 7.4
Ruby 2.6.3p62
RVM 1.29.9
When running Brew Doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
/opt/local/bin/python2.7-config
/opt/local/bin/curl-config
/opt/local/bin/ncursesw6-config
/opt/local/bin/pcre-config
/opt/local/bin/ncurses6-config
/opt/local/bin/pcap-config
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
(here it posts all the /usr/local/include/node files, but the list exceeds character limitations)
Any ideas on how to solve this error?
I had similar issue which I fixed this way:
brew reinstall php
I will answer my own question for others who might run into a similar issue
After having uninstalled and reinstalled every single keg of brew I found the following solution:
Uninstall PHP
Run brew cleanup
Check your /usr/local/opt folder for any folders named php
Delete the folder (in my case it was called 'php#7.1')
Open a new terminal window
Run 'brew search php' in the terminal and make sure no php keg is installed.
Simply type 'php -v' in the terminal. For me this showed a version number, indicating that php was (at one point) installed without brew. You can choose to uninstall this version or update it to the newest version.
Conclusion
In my case I believe it was simply that PHP 7.1 was already installed and I installed a 2nd version (7.4) via brew.
The error 'Referenced from: /usr/local/opt/php#7.1/bin/php' was obviously searching for something in this folder and after deleted it, the error stopped.
In my case, i had multiple version of php installed on my macOs, which was later remedies with laradock.
Primary problem:
❯ php -v
dyld[62395]: Library not loaded: /opt/homebrew/opt/icu4c/lib/libicuio.70.dylib
Referenced from: <31116583-6CB3-3C7B-AD46-52FF1431267E> /opt/homebrew/Cellar/php#7.4/7.4.30/bin/php
Reason: tried: '/opt/homebrew/opt/icu4c/lib/libicuio.70.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/icu4c/lib/libicuio.70.dylib' (no such file), '/opt/homebrew/opt/icu4c/lib/libicuio.70.dylib' (no such file), '/usr/local/lib/libicuio.70.dylib' (no such file), '/usr/lib/libicuio.70.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/icu4c/72.1/lib/libicuio.70.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/icu4c/72.1/lib/libicuio.70.dylib' (no such file), '/opt/homebrew/Cellar/icu4c/72.1/lib/libicuio.70.dylib' (no such file), '/usr/local/lib/libicuio.70.dylib' (no such file), '/usr/lib/libicuio.70.dylib' (no such file, not in dyld cache)
Also tried
❯ brew uninstall php
Warning: Calling plist_options is deprecated! Use service.require_root instead.
Please report this issue to the mongodb/brew tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
/opt/homebrew/Library/Taps/mongodb/homebrew-brew/Formula/mongodb-community.rb:55
As indicated "Referenced from" a php version was still installed after mutliple attempts of brew uninstall php
Solution:
rm -rf /opt/homebrew/etc/php
After above brew install php without a problem.
Hope this helps.

How can I get my current symfony installation run on a local server?

I have been working on a Symfony2 installation on a dedicated server for the past year and I'm finally trying to get it to work on my local server (since I am spending more time meddling with the code lately).
I've created a new database and imported it. Edited the parameters.yml file to contain all the info needed by local and ran php composer.phar install.
Ran php app/console doctrine:schema:update, clear cache, install assets and dumped assetics. No errors so far.
Now, when I go to the app.php file, I am getting this error :
Fatal error: Call to undefined function Doctrine\Common\Annotations\token_get_all() in [path]/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php on line 56
I couldn't find an answer by searching (could be because I am not sure what i am searching for). Has anyone encountered this issue before and know how to fix it?
Regards,
Do you have the PHP tokenizer extension enabled? Check the Symfony requirements for more information.
In Ubuntu 14.04 you could install it with
sudo apt-get install libapache2-mod-php5

Segmentation fault with Homebrew php56-xdebug

I've been running PHP 5.4 with xdebug on my Mac via Homebrew for a while, and yesterday I tried to upgrade to 5.6 with xdebug using the php56 and php56-xdebug formulas. I was able to get php56 working fine, but as soon as I install the php56-xdebug formula, Apache won't load, and I get a segmentation fault. If I remove php56-xdebug, everything works fine again. My php error log was showing that xdebug.so was trying to load twice, but I uninstalled everything php 5.4 (php54, php54-xdebug, etc.), so that went away. But for some reason, I can't get rid of my "Segmentation fault (11)" error message. I've triple checked my apache config settings and my xdebug.ini, and they are correct, as they always have been. I'm also not getting any errors in my PHP error log.
I've tried uninstalling php 5.6 itself, as well as the xdebug formula, all to no avail. Short of re-installing my OS, what do I need to do to get xdebug working?
Thanks.
Update: Per this issue, I installed php56-xdebug using --build-from-source, but the result is the same.
It looks like the problem was issues in the 2.3.x branch of xdebug. I ended up manually compiling xdebug 2.2.7 and got it to work that way.

Error installing Laravel 4 with composer

When I try to install Laravel 4 via Composer, I get the following message in Terminal
Mcrypt PHP extension required. Script php artisan optimize handling
the post-install-cmd event returned with an error
The PHP version on my computer is 5.5.3 and when I run phpinfo it shows that mcrypt is enabled. When I run the which php command in Terminal it shows
/usr/bin/php
I therefore extended the $PATH with .bash_profile.
export PATH=/Applications/MAMP/bin/php/php5.5.3/bin:$PATH
Unfortunately, the which php command still shows /usr/bin/php after extending $PATH. And as a result the error is still there.
So I am out of ideas on how to solve this issue. Does anyone have an idea? Thanks!
There is difference between the MAMP PHP version and you "Terminal" PHP version. Therefore are you probably setting up the export path.
When you are changing the export path you have to restart your terminal before it will take effect on your computer.
I am not sure of this but when your error is appearing and older version of Laravel will be installed.
What do you get when you execute: php -v in your terminal?

Categories