Xdebug .so file exists but still reported not found - php

This is /etc/php/7.2/cli/conf.d/20-xdebug.ini content:
zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.remote_autostart=off
and this is the error I get by running php:
PHP Warning: Failed loading Zend extension 'xdebug.so' (tried: /usr/lib/php/20170718/xdebug.so (libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/xdebug.so.so (/usr/lib/php/20170718/xdebug.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
However /usr/lib/php/20170718/xdebug.so exists and has read permission:
# ls -l /usr/lib/php/20170718/xdebug.so
-rw-r--r--. 1 root root 2078128 Jan 16 11:15 /usr/lib/php/20170718/xdebug.so
Changing extension path to full path doesn't make a difference either.
What can be the reason?

It seems that shipped xdebug module was corrupted and installing it through apt solved the issue:
apt install php-xdebug
I also tried and compiled source code many times before installing it through apt but I got the same error every time I did. Yet the exact cause remains unknown.

Refer to the below link as I think it will solve your problem as it did for me
Installing Xdebug

Try this content inside your xdebug.ini file
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.show_error_trace = 1 <--- you can skip this
xdebug.remote_autostart = 0

I imagine you are using a mac, the C header files are no able to be reached via /usr/include. There are a few ways to fix this, but compiling it yourself is probably the best way. I would recommend https://bbqsoftwares.com/blog/xdebug-catalina if you don't want to turn SIP off.

Related

In PHPstorm after configuration xdebug, stepover is disabled yet.what should I do? and one addition warning

Please guide me
No one here knows how to solve the problem!?
I use PHPstorm 2017.2.4 for php programming.
I configured phpstorm to debug by xdebug for use stepover and stepintro in debugging by jetbrain guid documents but just debugging is enable yet and other options is disable. screen shot of this:
How can I and What should I check to resolve this problem?
I googled and search in stackoverflow but I couldn't find my answer.
Update:
I couldn't solve that yet.
I explain all steps I have done :
first o all say that I use wamp 2.4 for local host server.(php 5.4.12, apache 2.4.4 , MySQL 5.6.12)
1- install phpstorm for use debugger such as step over an step into debugging.
2- use jetbrain guide documents to install debugger:
first check to find xdebug in wamp directory.
then edit last lines of php.ini file in wamp as following:
[xdebug]
zend_extension = "c:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll"
xdebug.remote_enable = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
3-Set php interpreter as follow image:
4-Then validate debugger here that don't disply any warning:
5-Enable listening for PHP debugger connection
6- Install chrome toolbar JetBrains IDE Support for web debugging.
7- I wentback to PHPstorm to debugging but just debug option was enabled and others was disabled as first image in this post.
In addition, after debugging the codes, the warning : "PHP Warning: include_once(): Failed opening '.\dref.php' for inclusiondisplay this warning. (include_path='.;C:\php\pear') in C:\wamp\www\srn\mrt\req_v.php on line 260" is displayed, while the same code works well in the WAMP(localhost:80) by Firefox browser.
in all php documents that has code similar to below :
include_once ('.\jd.php');
require_once(".\dref.php");
require_once(".\scur.php");
Then when I changed path for example ".\dref.php" in require_once to "..\dref.php" debugging dont display above warning ,But this timewhen open web by Firefox(localhost:80-wamp) display Warning: require_once(..\dref.php): failed to open stream: No such file or directory in C:\wamp\www\srn\mrt\req_v.php on line 26
Where do I make mistakes and how should I solve these problems?
Please guide me
No one here knows how to solve the problem!?

brew php54-xdebug Failed loading xxx.xdebug.so Symbol not found

I used brew install php54-xdebugļ¼Œthen I found php.ini and added some confs.
[xdebug]<br>
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"<br>
xdebug.remote_enable = On<br>
xdebug.remote_handler = "dbgp"<br>
xdebug.remote_host = "localhost"<br>
xdebug.remote_port = 9000<br>
xdebug.idekey = PHPSTROM<br>
I found this xdebug.so file get through zend_extension, when i tried to use less to open this file content, it pointed out xdebug.so" may be a binary file. See it anyway?
When I used php -a or do some other things about php, it will point out:
Failed loading
/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so:
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so,
9): Symbol not found: _zend_execute_ex Referenced from:
/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so Expected
in: flat namespace in
/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
Interactive shell
Find where your xdebug was located:
sudo find / -name xdebug.so
It will take some minutes.

PHP Warning: Module already loaded in Unknown on line 0

On Mac OSX Mavericks using homebrew php55 whenever I run a a php command I get the following error message (everything runs fine it's just annoying)
PHP Warning: Module 'intl' already loaded in Unknown on line 0
I ran
php --ini
and the output was
php --ini
PHP Warning: Module 'intl' already loaded in Unknown on line 0
Warning: Module 'intl' already loaded in Unknown on line 0
Configuration File (php.ini) Path: /usr/local/etc/php/5.5
Loaded Configuration File: /usr/local/etc/php/5.5/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.5/conf.d
Additional .ini files parsed: /usr/local/etc/php/5.5/conf.d/ext-apcu.ini,
/usr/local/etc/php/5.5/conf.d/ext-igbinary.ini,
/usr/local/etc/php/5.5/conf.d/ext-intl.ini,
/usr/local/etc/php/5.5/conf.d/ext-memcached.ini,
/usr/local/etc/php/5.5/conf.d/ext-mongo.ini,
/usr/local/etc/php/5.5/conf.d/ext-uuid.ini,
/usr/local/etc/php/5.5/conf.d/ext-xdebug.ini
Checked in the php.ini file and the only place intl is loaded is at the top and it's commented out. The other files contents look something like:
extension="/usr/local/Cellar/php55/5.5.23/lib/php/extensions/no-debug-non-zts-20121212/intl.so"
where the contents after the last slash is the extension.
I'm not sure where else to look.
Any help is appreciated
I think you have loaded Xdebug probably twice in php.ini.
check the php.ini, that not have set xdebug.so for the values extension= and zend_extension=.
Check also /etc/php5/apache2 and /etc/php5/cli/. You should not load in each php.ini in these directories the extension xdebug.so. Only one file, php.ini should load it.
Note: Inside the path is the string /etc/php5. The 5 is the version of PHP. So if you use another version, you always get a different path, like php7.
I had the same issue on mac i.e. Warning: Module 'pdo_pgsql' already loaded in Unknown on line 0.
Here's how I solved it.
Locate the folder conf.d, mine was in the directory
/usr/local/etc/php/7.0/conf.d.
In this folder, there's a file called ext-pdo_pgsql.ini.
Type sudo nano ext-pdo_pgsql.ini to edit it.
There should be a line extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so". Comment it
out by adding semi-colon to the beginning of the line i.e.
;extension="/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so".
Save the file. (I usually run control + O, control + M).
Exit the file (control + X).
Hope this helps someone.
To fix this problem, you must edit your php.ini (or extensions.ini) file and comment-out the extensions that are already compiled-in. For example, after editing, your ini file may look like the lines below:
;extension=pcre.so
;extension=spl.so
Source: http://www.somacon.com/p520.php
You should have a /etc/php2/conf.d directory (At least on Ubuntu I do) containing a bunch of .ini files which all get loaded when php runs. These files can contain duplicate settings that conflict with settings in php.ini. In my PHP installation I notice a file conf.d/20-intl.ini with an extension=intl.so setting. I bet that's your conflict.
In my case I had uncoment the ;extension=php_curl.so in php.ini, but Ubuntu was already calling this extension somewhere else.
To find this "somewhere else", on php.ini will informe. On my case:
/etc/php/7.1/apache2/conf.d/20-curl.ini was the path.
So now we edit this file (terminal):
sudo nano /etc/php/7.1/apache2/conf.d/20-curl.ini
Comment the ;extension=php_curl.so
Save file and restart apache:
sudo systemctl restart apache2
solved by commenting extension=curl
For issue related to code igniter project upload,
go to the base directory index.php and add this code:
if ($_SERVER['SERVER_NAME'] == 'local_server_name') {
define('ENVIRONMENT', 'development');
} else {
define('ENVIRONMENT', 'production');
}
if (defined('ENVIRONMENT')){
switch (ENVIRONMENT){
case 'development':
error_reporting(E_ALL);
break;
case 'testing':
case 'production':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
For shared hosting, in cPanel I unchecked the Module in question under "Select PHP Version" > "Extensions" and the error disappeared for PHP 7.4.
I had the same issue after upgrading from Fedora Server 24 (PHP 5) to 25 (PHP 7). After investigation, I found that /etc/php.d/ had two different .ini files loading extension=geoip.so.
Previous version of distros had this file named 50-geoip.ini but the recent was changed to 40-geoip.ini, and I suspect that in the version-upgrade process the old hasn't been removed, while the new one has been created.
That was the actual case of the issue. After removing stray 50-geoip.ini from /etc/php.d/ and restarting httpd it just worked flawlessly.
I deleted the 20-mongo.ini file in /etc/php5/cli/conf.d and this solved the problem.
I figured this out by printing the PHP configuration and searching by xml.ini. Notice in the following output how xml is loaded twice (first as 20-xml.ini and then as xml.ini):
$ php -i | grep xml
/etc/php.d/20-simplexml.ini,
/etc/php.d/20-xml.ini,
/etc/php.d/20-xmlwriter.ini,
/etc/php.d/30-xmlreader.ini,
/etc/php.d/xml.ini
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
libxml Version => 2.9.1
libxml
mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text /|application/xhtml\+xml)
xml
libxml2 Version => 2.9.1
xmlreader
xmlwriter
libxslt compiled against libxml Version => 2.9.1
There are two "php_intl.dll" files inside php.ini file on 872 and 968 number lines. if php warning module 'intl' already loaded in unknown on line 0 this message is focused on your CLI. Then you should have to remove the semiclone prefixes on line 872. I expect this will done.....
Just for the record as it might help others who are on shared hosting (cPanel).
I had error on shared hosting php7.2:
Module 'imagick' already loaded in Unknown on line 0
In the beginning hosting provider said it was my bad configuration (running Yii2.16). But after I showed them, that all Internet related this issue to server configuration -they started to listen to me. After I proved, that there was no error on php7.1 they started to search for the error.
As they told to me - the error was due to configuration in PERL modules or PEAR package, but they did not told me the real issue.
So, if you are on shared hosting - talk to you provider and experiment with PHP versions (if you can change them).
Comment out these two lines in php.ini
;extension=imagick.so
;extension="ixed.5.6.lin"
it should fix the issue.
In Windows 10, I fix this by comment like this
;extension=php_sockets.dll
Run php --ini and notice file path on Loaded Configuration File.
Then run command like cat -n /etc/php/7.2/cli/php.ini | grep intl to find if the extension is commented or not.
Then update loaded configuration file by commenting line by adding ; such as ;extension=intl
This can happen when you install php-intl package and also enable the same extension on php.ini file.
If you are on shared hosting, just apply the default php settings. Cpanel overrides php settings to default.
I am using WAMP in Windows 10 with PHP 7.2.10. I was able to solve it through commenting the line extension=ftp in php.ini inside wamp64\bin\php\php7.2.10 .
I am unsure but my guess why this happens is that my php.ini inside wamp64\bin\apache\apache2.4.35\bin already loads this module.
Be sure to restart all services of WAMP after doing so.
I had the same issue so I commented the extension=mysqli as I included this to run sql server. Check if you have uncommented this extension=mysqli if so, place ; in php.ini
I resolved this issue by removing php.ini file from extension=grpc commenting like this ;extension=grpc
I had a similar problem, the problem was that the extension intl was duplicated.
You can check in file C:/xampp/php/php.ini and find "intl". In my case extension=intl is already present and I scrolled again and found a second intl "extension=php_intl.dll".
The extension must one to execution can't execution extension intl again. This will show error like this "Module 'intl' already loaded".
I fixed it by commenting out extension=php_intl.dll using ";" like this ;extension=php_intl.dll. and restarted the apache service.

Installing php-module using port on osx lion. It works from command line but not from apache

I installed php5-intl on my osx lion.
It seems to work properly on command line mode because if I try to run the following script (1):
$fmt = datefmt_create( "en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN );
echo "First Formatted output is ".datefmt_format( $fmt , 0)."\n";
> php -m |grep intl
intl
> php test.php
First Formatted output is Wednesday, December 31, 1969 4:00:00 PM Pacific Standard Time
But if I try to sun the same from my apache (after sudo apachectl restart) I get the following error:
> tail /private/var/log/apache2/error_log
PHP Fatal error: Call to undefined function datefmt_create() in
P.S.:
I also added the following line to my php.ini
extension_dir = "/opt/local/lib/php/extensions/no-debug-non-zts-20090626"
ll /opt/local/lib/php/extensions/no-debug-non-zts-20090626
total 848
-rwxr-xr-x 1 root 261712 7 May 10:54 xdebug.so
-rwxr-xr-x 1 root 168912 31 May 19:53 intl.so
in php.ini is written: Loaded Configuration File /private/etc/php.ini which is the file I edited.
Other info on my configuration are the following:
/private/etc/apache2/httpd.conf
LoadModule php5_module libexec/apache2/libphp5.so
/usr/libexec/apache2/libphp5.so
/private/etc/php.ini
extension_dir = "/opt/local/lib/php/extensions/no-debug-non-zts-20090626"
Create a web page, with these contents:
<?php
phpinfo();
echo datefmt_create("en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL);
?>
(Yes, I know that 2nd line gives an error, but in this case it is enough to tell us it works.)
View that web page, and search for "Internationalization support" or "intl". In my case I see:
Internationalization support enabled
version 1.0.3
ICU version 4.2.1
Directive Local Value Master Value
intl.default_locale no value no value
intl.error_level 0 0
If you have no intl section present, then it can only be a php.ini issue (the more usual cause is not restarting apache, but you said you'd done that).
To confirm, edit the php.ini file again and at the very end introduce a change you can be sure will work. E.g. asp_tags = 1. Now reload your phpinfo() page and make sure you see the change there.
If you don't perhaps it is permissions; the user Apache runs as cannot read your php.ini file?

Why can't I configure Zend-framework

Racking my head as to why I can't include the Zend-framework into my project. The documentation is unclear about how to set up the environment (Or haven't found where it is). Looked at this thread: How to configure Zend Framework on linux machine? but no luck. In the phpinfo() I see Zend configured but why can't I use it? Looked for documentation on how to add this to PEAR/PECL, no luck.
I did see this post: http://devzone.zend.com/article/4683 but still not working
What I have tried:
Option 1
require_once('/usr/share/php/libzend-framework-php/Zend/Loader/Autoloader.php');
Zend_Loader_Autoloader::getInstance();
Option 2
sudo vi /etc/php5/apache2/php.ini
changed this line:
;include_path = ".:/usr/share/php"
to:
include_path=".:/usr/share/php:/usr/share/pear:/usr/share/php/libzend-framework-php"
restarted Apache
Getting this error:
Warning: require_once(Zend/Loader.php): failed to open stream: No such file or directory in /usr/share/php/libzend-framework-php/Zend/Loader/Autoloader.php on
line 24
Call Stack:
0.0002 61600 1. {main}() /var/www/webservice/zend/server.zend.xmlrpc.php:0
0.0009 174412 2. require_once('/usr/share/php/libzend-framework-php/Zend/Loader/Autoloader.php') /var/www/webservice/zend/server.zend.xmlrpc.php:2
Fatal error: require_once(): Failed opening required 'Zend/Loader.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/php/libzend-framework-p
hp/Zend/Loader/Autoloader.php on line 24
Call Stack:
0.0002 61600 1. {main}() /var/www/webservice/zend/server.zend.xmlrpc.php:0
0.0009 174412 2. require_once('/usr/share/php/libzend-framework-php/Zend/Loader/Autoloader.php') /var/www/webservice/zend/server.zend.xmlrpc.php:2
i would suggest to
chmod 775 /usr/share/php/libzend-framework-php -R as Ran BarZik suggestion .
and double check the apache user's permissions .
then symlink it to the your application library by using this :
ln -s /var/www/webservice/library/Zend /usr/share/php/libzend-framework-php/
I;ve installed Zend FW on many Linux system and if I encountered problems it was on the include path that was set incorrectly or permission problem.
Maybe the path isn't right, try 'vi /usr/share/php/libzend-framework-php/Zend/Loader/Autoloader.php' or any other text editor that you like. Does it work?
Maybe it is permission problem, try to change /usr/share/php/libzend-framework-php/ to 755:
chmod 775 /usr/share/php/libzend-framework-php -R
Your main configuration should be in: application/configs/application.ini
This tells the zend controller where to look for the library files etc.
Did you look here when you were installing? : http://framework.zend.com/manual/en/learning.quickstart.create-project.html
According to the error messages, your updated include_path isn't being picked up.
What does phpinfo() have to say about your include_path?
What if you set_include_path(get_include_path . ':/usr/share/php/libzend-framework-php'); before your include?
I'm assuming here that /usr/share/php/libzend-framework-php/Zend exists...
Try to move zend library:
cd /usr/share/php/libzend-framework-php
mv library/Zend /usr/share/php/
revert include_path to original:
include_path = ".:/usr/share/php"
Restart apache
After banging my head up against the wall for a couple of days I think I figured it out. Looking at this page: http://devzone.zend.com/article/4683 I understood I needed to add the zend path in the php.ini file. I did this with no effect. After looking at my PHP Configuration I noticed in /etc/php5/conf.d/ I could load zend by uncommenting the library path in the zend-framework.ini file which PHP loads as an additional module/ini

Categories