I have PHP 7.0.0 on IIS 7, Windows 10 and FastCGI all installed via the web platform installer. I am attempting to install xdebug by pasting my phpinfo() into the wizard and follow the instructions.
The problem is I am unable to configure it as a zend_extenson. When I go into PHP Manager in IIS and enable the xdebug extension, I get the following lines inserted into the php.ini file:
[PHP_XDEBUG-2.5.0RC1-7.0-VC14-NTS-X86_64]
extension=php_xdebug-2.5.0rc1-7.0-vc14-nts-x86_64.dll
If I change the line to be zend_extension instead and refresh the extensions listed in the PHP Extensions screen of IIS, it will show as disabled again. If I enable it again, it will go back to what you see above. IIS does not like zend_extension=. What am I missing?
I also see the following in the PHP log file:
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
It turns out I had to downgrade xdebug to 2.4.1 and the connection showed up in PHP Storm. I also used the following settings in my php.ini file. The extension will not show as enabled in the IIS PHP Manager but it actually is enabled as verified on the phpinfo() page.
[PHP_XDEBUG]
zend_extension=php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.idekey=PHPSTORM
No need to downgrade simply replace,
extension=php_xdebug.dll
with
zend_extension=php_xdebug.dll
verified to be working with Xdebug version 2.6.1 iis 7
Related
I've been making upgrades on my Dev workstation using XAMPP for a long time now, from the various version 7s up through 8.012.
I seem to have hit a wall upgrading to 8.1.
I've edited the apache config to use the new version of php. Taking the php.ini-development and renaming it to php.ini, then uncommenting the openssl extension has no effect after I restart apache:
extension=openssl
Openssl isn't enabled in the php info page:
And if I try and enable mongodb by moving my extension over from the previous installation, and uncomment the extension in php.ini and restarting apache again I get an error:
extension=php_mongodb.dll
Update: I now find that enabling ANY PHP module does not work under PHP 8.1.
I can roll back to the previous version of php-8.0.12 and have a fully functioning php again. When I roll back to the previous version enabling and disabling PHP modules still works. It does not work under PHP 8.1.
I'd like to stay up to date with the latest release if at all possible!
What am I doing wrong with this version of PHP? Why can't I enable anything?
I've had to set the FULL PATH to the extensions directory on Windows. Once I did that and restarted, I was able to enable / disable extensions. Look for this line in php.ini and adjust it to your needs:
; On windows:
extension_dir = "C:\xampp\php-8.1.0\ext\"
This setting only seems important on Windows. Set that line the way you want it, restart apache and you should be good to go!
You are copying an incompatible module compiled with the older version. If you are upgrading the PHP version, You'll need an extension DLL file compiled with that specific version of PHP and suitable for your server environment. You can download the compatible packages from here PECL. Download and put the .dll file in your extension directory. Then, you'll need to enable that extension.
Here is the guide for the windows system Installing a PHP extension on Windows.
For MongoDB, get it here https://pecl.php.net/package/mongodb
while trying to install Moodle, I got a message saying i should check the PHP settings to enable OPCache.
I followed the instructions and since I am on MacOS it says I have to
"use the zend_extension configuration to load the OPcache extension into PHP by adding to php.ini.".
The problem is I can't find anywhere the opcache.so lib. I've looked in all the subfolders of AMPPS/php-5.6/ as well as other folders from AMPPS but it's nowhere to be found.
I've tried just enabling all the config keys with the suggested values in that link and restarting Apache but Moodle still displays the same message.
Looking at the PHPInfo page I see the following in the configure command section:
'--libdir=/Applications/AMPPS/php-5.6/lib' '--enable-opcache=no'
Does this mean the PHP 5.6 packaged with AMPPS was compiled without OPCache? If so how do I get around this?
Or am I simply missing something?
I have been dealing with an unexpected error when trying to setup xdebug 2 with PhpStorm (2016.2.2). It says:
Connection with 'xdebug 2.5.0rc1' was not established. Validate installation.
I decided to ask for help because I cannot solve this error for 3 days already and I have tried everything I could.
These are the setup steps that I did:
pasted my phpinfo here (https://xdebug.org/wizard.php) and downloaded the recommended php_xdebug.dll (php_xdebug-2.5.0rc1-5.5-vc11-nts-x86_64).
copied php.ini file into bin\php\php5.6.0 and added these lines of code:
[Xdebug]
zend_extension = C:\MAMP\bin\php\php5.6.0\ext\php_xdebug-2.5.0rc1-5.6-vc11.dll
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.idekey=PHPSTORM
xdebug.remote_port = 80
xdebug.profiler_enable=1
Installed "JetBrains IDE Support" and "Xdebug helper" extensions for Chrome browser.
Sometimes I manage to debug (I guess) without an error but I get an error on browser which says "No direct script access allowed".
I am on Windows 10 x64 running MAMP 3.2.2 with php 5.6.0. Don't know what more details I can provide right now but it looks enough.
The problem that I had was on the other laptop that I use. Both of them use the same settings (win10, MAMP 3.2.2). On my second laptop (the one I am currently typing from) this is php.ini settings:
PHP version: 5.6.0 PHP CLI: C:\MAMP\bin\php\php5.6.0\php.exe PHP CGI:
C:\MAMP\bin\php\php5.6.0\php-cgi.exe Loaded Configuration File:
C:\MAMP\bin\php\php5.6.0\php.ini Debugger extension: xdebug 2.4.1
It uses xdebug 2.4.1 and I dont get the error on this laptop. I will try to get the same xdebug version to my first laptop and see if it works.
And this is the only command I added to php.ini on the second laptop (xdebug functioning) "zend_extension = C:\MAMP\bin\php\php5.6.0\ext\php_xdebug-2.4.1-5.6-vc11.dll" . Does it even make sense that without extra Xdebug settings it could even run?
Unable to enable XDEBUG. Any help or check if it is enabled and not reflected? I am on PHP7 and am using Xdebug 2.4.0rc2. PHP.INI settings below:
[XDebug]
zend_extension="C:/php/ext/php_xdebug.dll"
xdebug.remote_enable = on
xdebug.remote_host = localhost
xdebug.remote_port = 10000
xdebug.remote_handler = dbgp
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = "profilerlogs"
xdebug.profiler_output_name = cachegrind.out.%p
Unable to get it enabled. The steps are right but doesnt show up installed in phpinfo() as well.
I had same problem with XAMPP PHP7 now it's solved :)
There should be missing or wrong extention file in your C:/php/ext/ directory.
This will solve your problem.
Go to xDebug
Dowload Xdebug 2.4.0rc1 (PHP 7.0 VC14 TS 32/64)
Rename it to php_xdebug.dll
Paste this file in "php/ext" folder
Restart your server.
Now check your phpinfo()
In my case there were 64bit version so I've just changed to 32bit
Along with what #haider-lasani said please do not forget what type of PHP you are using. The latest XAMPP is using some really convoluted setup.
Go to your PHP folder and check whether you have php7.dll or php7ts.dll. If you have the latter version then you are supposed to pick up the TS version of xdebug.
Also check VC version as well.In this case it is VC14.
Now even though I am using a TS version of PHP I still have to add the plugin with zend_extension="C:/php/ext/php_xdebug.dll" and not zend_extension_ts="C:/php/ext/php_xdebug.dll"
TL;DR
While downloading xdebug make sure you:
Check x64/x86 bit version.(Use x86 xdebug just to be safe)
Check what version of PHP you are using.
Check whether you have TS or non-TS version of PHP by checking whether you have php{x}.dll or php{x}ts.dll.{x}is your php version.
Try switching between zend_extension and zend_extension_ts to include your xdebug plugin in your php.ini file to see what works.
Following all these steps should ideally fix your problems. Let me know if you still are facing any problems. Peace.
You shouldn't need to rename your DLL and it is a good idea not to, as it allows you to see what build of XDebug you have running.
Here is what I did and it works:
This answer assumes you have PHP set up with the correct PATH entry so that you can run PHP from the Command Line such as GitBash https://git-for-windows.github.io/
Open up your command line and enter this:
$ php -i
Scroll to the top and copy the output from the command line window beginning where you see
phpinfo()
..... copy contents until you see the last line which ends:
If you did not receive a copy of the PHP license, or have any
questions about PHP licensing, please contact license#php.net.
`
Go the XDebug Windows Wizard https://xdebug.org/wizard.php and paste your PHPInfo in the big text box and submit.
A new page will display with instructions and a "System Summary of your PHP. Carefully follow the instructions and select the Download link.
Once you have modified your PHP.ini and observed where your "ext" folder is, copy your downloaded XDebug dll file to "ext" folder.
Open your command line again and enter the following command:
$ php -m
If you have correctly followed the instructions you will see the output contains the following:
[Zend Modules]
Xdebug
Otherwise, you will see an error at the top of the console output such as:
Cannot load Xdebug
Usually, the errors occur because your XDebug:
is not in the correct location
is the wrong version
is incompatible because of thread type: Your PHP maybe Thread Safe, and your XDebug is Not Thread Safe (the XDebug Wizard will automatically choose the correct version)
If you are doing remote development on either a WSL or a Linux, check your php directory as you may need to modify php.ini files in the following locations:
/etc/php/7.2/apache2/php.ini
and
/etc/php/7.2/cli/php.ini
with
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
;don't forget to change the path and filename to the correct one
;but make sure you use the full path
zend_extension="/usr/local/php/modules/xdebug.so"
I installed Xampp like a week ago. It was already installed with a php_xdebug.dll file in the ext folder.
For me the solution was to specify the xdebug file like below, without a file path:
zend_extension = "php_xdebug.dll"
If you're on Windows 10 x64 running PHP 7.2 and Apache 2.4, Specifying DLL without the full path like this
zend_extension = php_xdebug-2.8.0-7.2-vc15-x86_64.dll
worked for me because my extension_dir = "ext" was set properly in php.ini.
Here is a detail set of instructions if you're using similar setup.
I'm on windows 7 with PHP 5.4.4 TS. I'm trying to load the zend debugger extension, it's the last line on my PHP.ini file:
[Zend]
zend_extension_ts = C:\php\ext\ZendDebugger.dll
zend_debugger.allow_hosts = 127.0.0.1/32,192.168.0.1/32,10.0.0.0/8
zend_debugger.expose_remotely = always
The extension doesn't show up when I call the phpinfo() section. There is nothing in the error logs though. The extension that I am using is for PHP 5.3 though so that may be why it's not loading properly. Does anyone know if there is a TS version for PHP 5.3+ ?
I had the same problem with PHP 5.4.11. It looks like thread safe versions of ZendDebugger.dll are no longer available. Using zend_extension (instead of zend_extension_ts) with ZendDebugger.dll for 5.3.x (max version I could find) did not work for me either.
In the end I solved the problem by switching to xdebug from xdebug.org. Downloaded php_xdebug-2.2.1-5.4-vc9.dll from http://xdebug.org/download.php and adjusted php.ini as:
zend_extension="C:\php_5_4_11\ext\php_xdebug-2.2.1-5.4-vc9.dll"
zend_debugger.expose_remotely=always
xdebug.remote_enable=on
xebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000