I downloaded php_xdebug-2.0.5-5.3-vc9.dll, added at the end of PHP.ini the following line:
zend_extension_ts="C:/Program Files/php5/ext/php_xdebug-2.0.5-5.3-vc9.dll"
When I use phpinfo(), xdebug is not loaded.
When I run command "php.exe -m", it not loaded as well.
How can this be resolved?
My configuration: PHP 5.3.1, Apache 2.2.14 with Apache Module, OS: Windows Vista
Both php and xdebug are thread safe.
This is somewhat similar with:
Apache not loading Xdebug, but does when started from the Command Line
EDIT:
I use VC6 dll and fixed configuration:
zend_extension="C:/Program Files/php5/ext/php_xdebug-2.0.5-5.3-vc6.dll"
Still can not find xdebug in phpinfo() output.
zend_extension_ts is deprecated on >5.3. Try it with zend_extension instead.
use zend_extension instead of zend_extension_ts
and look carefuly
"Compiler" , "Thread Safety" , "Architecture" and PHP Version
parameters in phpinfo()
example my php info say
PHP Version 5.3.1
Compiler MSVC6 (Visual C++ 6.0)
Architecture x86
Thread Safety enabled
so i used Xdebug 2.1.0 / 5.3 VC6 (32 bit)
You should probably not use the VC9 version, but the VC6.
For more informations, see the block "Which version do I choose?" in the left-sidebar of http://windows.php.net/ which states (quoting) :
If you are using PHP with Apache 1 or
Apache2 from apache.org you need to
use the VC6 versions of PHP
If you are using PHP with IIS you
should use the VC9 versions of PHP
Do NOT use VC9 version with apache.org
binaries
Also, quoting the Installation page of Xdebug's documentation :
From PHP 5.3 onwards, you always need
to use zend_extension and not
zend_extension_ts.
I have the exact same problem on Windows 7 too. It didn't work for me but perhaps for you it does. Xdebug has a special service page which helps you find out which version to download and what steps to take: http://www.xdebug.org/find-binary.php.
Following this didn't work for me unfortunatly. When I perform 'php -m' xdebug does not appear in the loaded modules list.
perform php --ini to check witch config file is loaded.
if you have something like this :
Loaded Configuration File: (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
Just copy your php.ini in windows directory ;)
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
I'm having huge problems installing memcached extension for php.
Currently using:
OS: Windows 10 x64
PHP: 7.0.1 via XAMPP
Apache: 2.4.18 (Win32)
I have successfully installed memcached in C:/memcached the service is running.
But the problem starts when trying to add the memcache php extension. I've tried numerous versions of php_memcache.dll and non seem to be working. I did include the extension in php.ini extension=php_memcache.dll
When i run php -m memcache is not listed and at the top i recieve the error:
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_memcache.dll' - The specified module could not be found.
And when I try running a test.php for memcache initialization i recive the Class not found exception
This is a huge problem, because I need it for running selenium tests.
The memcached service doesn't actually install the PHP memcached extension for you. It only installs the memcached server used to store your cache.
You'll need to download the Windows DLL from the PECL repository first (click on the blue Windows DLL link). Then you must add the extension=php_memcache.dll line to the correct php.ini file for your SAPI. Also, note the extension DLL file needs to be placed in the correct path for your XAMPP installation.
For Apache, simply create a script in your document root with the line <?php phpinfo(); and try loading that in your web browser. You should see a line at the top labeled Loaded configuration (php.ini) which gives you the full path to your loaded php.ini file. On Windows the path may actually appear different than what is stated in phpinfo() if you installed PHP through something like XAMPP. So you may need to rely on XAMPP to locate the correct php.ini file.
For the CLI SAPI, you can use php.exe --ini to do the same. Again, you may need to rely on the XAMPP package if it has modified your configuration path (since this is a compile time directive).
After making your changes to php.ini you will need to restart PHP for the changes to take effect.
Since you're using PHP 7 on Windows it's probably also important to note that the compiled DLL from PECL may not actually work under apache for Windows, because you're more than likely using a theaded SAPI. So make sure you are downloading the correct version. As far as I can tell that version is only compiled to work with up to PHP 5.6. The github alternative, for PHP 7, available at https://github.com/nono303/PHP7-memcahe-dll as mentioned in the comments is tested under non-thread safe. So you may only be able to get this working for your CLI scripts on Windows.
On windows 7 xampp 5.6.19 and symfony 2.8 dev environment configuration i was prompted "install and/or enable a php accelerator (highly recommended)". How to resolve this recommendation/warning?
I found the answer to my question here: http://www.ivangabriele.com/php-how-to-install-php-accelerator-in-xampp/
here is instruction just in case the site goes away:
to show you PHP configuration via the PHP function phpinfo()
to get 2 precious informations :
architecture: x86 or x64?
TS (Thread Safe) or NTS (Non Thread Safe)?
to download the corresponding DLL (including your PHP version):
http://pecl.php.net/package/APCu/4.0.8/windows
(PHP 7: https://pecl.php.net/package/APCu/5.1.17/windows)
to copy/paste the DLL file within your extensions directory (C:\xampp\php\ext)
to edit your php.ini file (i.e. within C:/xampp/php directory)
to add this line inside Dynamic Extensions part :
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
[...]
extension=php_apcu.dll
finally, to restart Apache - done.
NOTE: It is php_apcu.dll not php_apc.dll and click on Windows icon for Windows versions https://pecl.php.net/package/APCu
Tested and works on Windows 10.
I have installed MAMP 3.5 with Apache 2.4.16 on Yosemite 10.10.5 and have run into some obstacles that I find hard to solve.
The first issue was that virtual host settings have changed in Apache but that I managed to fix.
The remaining problem is with extensions. I use gettext in an application and it can not be found.
php -v says PHP 5.6.10 (cli)
phpinfo() says PHP 5.5.27
php --ini says /Applications/MAMP/bin/php/php5.6.10/conf/php.ini
The php.ini path seems to be correct although phpinfo() says that extension_dir is /usr/lib/php/extensions/no-debug-non-zts-20121212
This seems very strange to me? The gettext extension is not in this directory but is found along with all other relevant extensions in the directory listed in the php.ini file for PHP 5.6.10 which is the one that should be used...
Any ideas what has gone wrong and how I can make PHP use the correct ini file?
CLI uses the installed version of OSX, MAMP uses it's own version.
The easiest way to use same version for both is to add the MAMP version first in your path in ~/.bash_profile.
export PATH=/Applications/MAMP/Library/bin/:/Applications/MAMP/bin/php/php7.0.0/bin/:~/bin:$JAVA_HOME/bin:$PATH
of course you need to replace the php7.0.0 part with the version you want to use.
Quit your terminal app and reopen it, and try php -v again.
I am having apache 2.2.14, php 5.3.1 and mysql 5.1.43 installed on vista. I am trying since 2 days to configure php to have mysql enable on phpinfo().
I modified php.ini to have extension_dir = "c:\php\ext"
modified the extension as extension="php_mysql.dll"
added "c:\php" to the "PATH" environment variable and restarted the vista.
after trying many combinations of putting php.ini, php_mysql.dll and libmysql.dll in c drive and/or c:/windows and/or c:/windows/system32 now I am with no options!!
I do restart the apache after each modification. I used libmysql.dll present in mysql installation and that of older php version as php 5.3.1 has no libmysql.dll...
Any help will be appreciated.
Thanks in advance.
You have to edit php.ini and add/uncomment a line to import the php_mysql.dll extention. Search for ;extention=php_mysql.dll and remove the ;. If you find this line without the ; in front of it, you have another problem. If you don't find this line, add it without the ;.
You can also try to put a \ after the extention path: extension_dir="c:\php\ext\"
put php_mysql.dll in the "c:\php\ext" directory (and keep the extension="php_mysql.dll" uncommented [without the leading ;])
Make sure you've edited the right php.ini. In case of doubt
<?php echo 'ini= "', get_cfg_var('cfg_file_path'), '"';
will tell you which one is used by your php installation.
Maybe php tried to load the php-mysql extension and failed because of additional dependencies. That would cause a startup error entry in the error.log.
Which php-build do you use? The php-mysql extension can either use libmysql.dll as transport layer or the new mysqlnd (MySQL native driver) module. You've added c:\php to PATH. That's usually done in order to let windows find libmysql.dll (though it's not necessary, there are other methods which I prefer). If php-mysql depends on libmysql.dll and windows can't find it loading php_mysql.dll will fail.
But if you're using the php.net build of php 5.3.1 the mysql module uses mysqlnd:
Installation on Windows
In the official PHP distributions from 5.3 onwards, MySQL Native Driver is enabled by defaultThis module is built-in in the php.net build. You can test that by calling php -m in a command shell. It prints all built-in modules.
Thanks a lot to the user who said that we have to move the file php.ini to the folder /bin of the Apache server. it resolves me the same problem after more than one week of trying failed methods.
Of course we must uncomment in the file the two lines;
;extension=php_mysql.dll
;extensin_dir="ext"
by removing the semi-colon (;) and by specifying the full path for the extension library php_mysql.dll rather than ext as follows
extension=php_mysql.dll
extensin_dir="c:\Apache22\php53\ext"
For me I installed Apache in the folder c:\Apache22 and PHP in the folder c:\Apache22\php53, you must use your own values.
NOTE: Because mysql_ functions like mysql_connect() become deprecated in PHP 5.5 and above, it is recommended to enable also the library php_mysqli.dll to use functions like mysqli_ (improved version of mysql_ functions). To do that it is simple, you just have to uncomment the line:
;extension=php_mysqli.dll
in the file PHP.ini as follows:
extension=php_mysqli.dll
Update April 7, 2013. Installed Windows 8 on an i7 Quad, HT 8, 3.62GHz, 12GBRAM.. Installed the latest version of MySQL, got it functioning properly. Installed the latest version of Apache Web Server, got it functioning properly. Installed the latest version of PHP, got it functioning properly. MySQL could not connect to the database. The error message was "mysql_connect function undefined". I copied the modified php.ini file into the "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin", and restarted Apache web server... then it all magically started working.!!! I hope this helps somebody with setting up their own Windows MySQL / PHP web server.