its been 3 days of research, google and frustration to make imagick work on my XAMPP box. I can get as far on making it as php module. But it cannot detect supported formats.
As you can see, I currently have 3.1.2 installed, but I actually worked all the way from the most recent 3.4.1 and jumping from those releases tagged with stable but I just can't make it work.
When I try to run:
<?php
$handle = fopen('http://xxxxx.png', 'rb');
$img = new Imagick();
$img->readImageFile($handle);
$img->thumbnailImage(100, 0);
echo $image;
I am getting:
Uncaught exception 'ImagickException' with message 'Unable to read image from the filehandle' in xxxxx:5 Stack trace: #0 xxxxx\index.php(5): Imagick->readimagefile(Resource id #3) #1 {main} thrown in xxxxx\index.php on line 5
What I have is:
Windows 8.1 64-bit
PHP 5.6.12, x86, TS
(http://i.imgur.com/2pnneqO.png)
This is what I actually have done so far, in terms of installing it:
Download any -Thread Safe (TS) x86 package from
https://pecl.php.net/package/imagick
Extract the .zip (1) php_imagick.dll to C:\_XAMPP\php\ext (2)
Extract CORE_RL_* files to C:\_xampp\apache\bin
Download ImageMagick-7.0.1-1-Q16-x86-dll.exe from
Link
Installed it at C:\ImageMagick
Add MAGICK_HOME to environment PATH. http://i.imgur.com/jQAWl3W.png
All *_.dll file in C:\ImageMagick\modules\coders copy to
C:\_Xampp\apache\bin
All *_.dll file in C:\ImageMagick\modules\coders copy to
C:\ImageMagick\
Restart Apache via Xampp
And still can't make my PHP detect Imagick supported file formats even though they should be http://prntscr.com/b1l54u :((
Can somebody tell me what did I miss? Please?
You seem to be going a bit of a convoluted route.
The method I used to install it when I had it running was:
Download and install Ghostscript with an exe file
Download and install imagemagick with an exe file - make sure you let it add the path to the environmental variables. You may not need this step but I wanted to use Imagemagick I'm my website and on my computer anyway.
Download the Imagick dll file and put it in the recommended folder - I can not remember which now.
Uncomment the Imagick option in the php.ini file. I had
two or three php.ini files on my system and I did it in each one.
Turned off the computer and restarted. Started XAMPP and it worked.
This only worked for a couple of installs and when I upgraded the operating system I could not get it to work due to incompatible versions of php and the Imagick.dll. If I should ever want to use Imagick I would do it on my server as the hosts installed it there for me.
You can still write your code locally and test it on your production server. It is a bit of a pain but would probably be quicker/easier than trying to get Imagick working on your PC.
Out of interest I gave up with it and use Imagemagick with exec() and the command line.
So, I already followed all the steps below for saprfc windows installation.
1) Extract zip file saprfc-$VERSION$-$PHP_VERSION$.zip
2) Copy php-saprfc.dll to your extensions directory (e.g. C:\PHP\extensions)
3) Edit php.ini file (in windows system dircetory, e.g. C:\WINNT, C:\WINDOWS)
and add line: 'extension=php_saprfc.dll'
4) Copy librfc32.dll (from SAPGUI install CD) to the windows system
directory or simple install SAPGUI on your machine.
Another source said we will we need SAP SDK. Is it really needed for Windows?
Also, will it be possible to code PHP connect to SAP in a computer that doesn't have SAP program? Or we only can do those installations in computer that has SAP application?
Then after the installation, what do I have to do next? I am trying to do steps below, yet still confused....
1) Extract php sources to C:\PHP-x.y.z
2) Extract php win support files to C:\PHP-x.y.z\win32
3) Install RFCSDK to C:\PHP-x.y.z\rfcsdk
4) Copy SAPRFC sources to C:\PHP-x.y.z\ext\saprfc
5) Copy php4ts.lib or php5ts.lib (from PHP binaries) to C:\PHP-x.y.z\win32
6) For PHP5 copy saprfc.dsp5 to saprfc.dsp
6) Open project C:\PHP-x.y.z\ext\saprfc\saprfc.dsp in Microsoft Visual C++ 6.0
7) Under Tools|Option|Directory set path for Include files and for Library files
(C:\PHP-x.y.z\win32\include; C:\PHP-x.y.z\rfcsdk\include;
C:\PHP-x.y.z\win32\lib; C:\PHP-x.y.z\rfcsdk\lib)
8) Set active configuration to "saprfc - Windows_TS" (under Build menu)
9) Build php_saprfc.dll.
10) Compiled DLL you find in C:\PHP-x.y.z\Release_TS directory
Where to get PHP sources, PHP win support, and how to compile the program?
Sorry, I am totally new to this. Looking for the answers. Thank you very much!
Building "windows extensions" is explained in general here:
https://wiki.php.net/internals/windows/stepbystepbuild
There is also explained which version of VS you need for which PHP version.
I also tried to build the sapnwrfc extension for PHP 5.5 on windows, but failed at some part...my progress/documentation is here:
https://github.com/piersharding/php-sapnwrfc/issues/6
Maybe you can progress further :-)
I have a simple setup of IIS 7 with PHP 5.4. Everything has been working fine until I needed to add MS SQL Server support. I downloaded the SQLSRV package provided through this link, extracted the appropriate DLLs to my PHP ext directory and added the extension entry/configuration in php.ini like so:
; MS SQL Server
extension=php_sqlsrv.dll
;extension=php_pdo_sqlsrv.dll
[sqlsrv]
sqlsrv.LogSubsystems=-1
sqlsrv.LogSeverity=-1
sqlsrv.WarningsReturnAsErrors=0
... with an additional change to the extension_dir setting:
extension_dir = "ext"
..., and restarted my server. Now, when I run any request, I get:
PHP_RINIT for php_sqlsrv: entering
sqlsrv.WarningsReturnAsErrors = Off
sqlsrv.LogSeverity = -1
sqlsrv.LogSubsystems = -1
sqlsrv.ClientBufferMaxKBSize = 10240
PHP_RSHUTDOWN for php_sqlsrv: entering
Sometimes, the first line is missing, but it's generally the same problem. No page is generating proper text/HTML anymore! What has happened? Thanks.
On the balance of probability, I imagine you're using the wrong sqlsrv dll. First things first: did you download SQLSRV from here?
I'll assume you want the PDO version (I use it; it works very well!). From the file name, I can't tell what you have, but for your circumstances you should should be using php_pdo_sqlsrv_54_nts.dll. As you're using IIS, you'll have an NTS version of PHP, which should be used with non thread safe extensions.
Try replacing the dll you're using with that one, and reload the application pool in IIS. phpinfo() should show sqlsrv as an available PDO driver. Let me know how you get on... :)
I am trying to get xdebug working with eclipse (3.5) / php (on xampp windows 7). I have verified xdebug is enabled in php - I have the fancy output and my phpinfo shows all the xdebug stuff. I have remote debug on, and typed in the lan ip address on my eclipse machine.
When I tell eclipse to debug, it launches the browser and passes the debug URL parameters. That looks OK.
However, in eclipse debug perspective it shows 'launching myproject' 57% 'waiting for xdebug session'. It sits there forever.
I have turned off windows firewall on both machines.
I tried turning implicit flush on.
Any ideas?
I had this problem too and I was missing this line in the php.ini file:
xdebug.remote_enable = On
Make sure you defined zend_extention with ABSOLUTE path in the php.ini:
e.g.: zend_extension=D:\SANDBOX\server\php\php_xdebug-2.1.0-5.3-vc6.dll
I'm debugging a local project on Windows. So far I did not need xdebug.remote_enable = On.
Suggestions if the Xdebug session does not start (hangs at 57 %), make sure that:
zend_extention directive is set with absolute path and the debug is loaded, use phpinfo() to check
firewall does not block the default 9000 port or Eclipse.
another application is not using the port (execute: netstat -an |find /i "listening" from the command line)
If you need to setup a different port use in php.ini:
xdebug.remote_enable = on
xdebug.remote_port = XXXX
and correct the Xdebug settings in Eclipse:
I had the same problem and I fixed it by changing the port to XDebug (now using port 9001).
Here is my php.ini content:
zend_extension ="C:\...\EasyPHP-5.3.3\php\ext\php_xdebug-2.dll"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.remote_mode=req
xdebug.remote_autostart=0
Also check the apache log file and make sure that you don't have the following Warning message:
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
If you do, open the php.ini file and comment with a ';' the extension=php_xdebug-2.dll line:
;extension=php_xmlrpc.dll
extension=php_xsl.dll
**;extension=php_xdebug-2.dll**
;/PHPExt
After fighting for 3 hours and trying out every solution on forums, I found out that the simple trick was to remove the quotes while specifying the path of the Xdebug dll in zend_extension in php.ini. I am using XAMPP (PHP 5.3.6 + Apache 2.2)+ Eclipse Indigo + PDT + Xdebug 2.1.2 on Windows Vista.
Here is the exact configuration that worked for me -
zend_extension=C:\xampp\php\ext\php_xdebug-2.1.2-5.3-vc6.dll
#Note that the path above is not in quotes
xdebug.remote_enable=true
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir=C:\xampp\tmp
I have used port 9001 so that it does not clash with 9000 in case that's already used by another program. Make sure this matches the port in Eclipse > Preferences > PHP > Debug > Xdebug too. Also, restart apache after editing php.ini.
Once I added this to php.ini, everything worked like ice cream.
I had the same problem with Zend Studio. I have noticed that the xdebug session was not starting properly. I passed this string to the url once and it worked since then.
http://localhost/myalias/?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=13750956767461
I'm sure it's a matter of configuration somewhere in the IDE.
I realized that TCP port was in use and that was the reason why it was hanging. I changed port in php.ini and eclipse settings.
Check that Eclipse's web browser settings are correct.
Window/Preferences/General/Web Browser/external Web Browsers/Edit settings
In my case, the path to the external web browser binary was incorrect. It said "/usr/bin/mozilla" instead of "/usr/bin/firefox".
Don't know how this setting came about, but after changing it the firefox browser window came up at last.
I looked into apache log and there were many lines with file not found error.
Run -> Debug configurations -> PHP web page -> Your_configuration
I unchecked auto generate and set filename to index.php.
It seems that in case of any mistake that prevents eclipse from normal functioning causes this "waiting for session"
I had the exact same problem. My configs were par with yours and in addition to having xdebug.remote_enable = On in the php.ini file also adding the following:
xdebug.remote_connect_back=1
this enables multihost remote debugging, as an alternative you can define the host IP.
xdebug.remote_host=IP_ADDRESS
For me, adding the [xdebug] configurations suggested by others to a php.ini file kept in following path C:\wamp64\bin\apache\apache2.4.23\bin helped. Essentially it's a symbolic link that points/links to phpForApache.ini file under your respective php version folder that gets installed with wamp64 e.g. php5.6.25.
In nutshell, adding following lines phpForApache.ini to helped me -
zend_extension = c:\wamp64\bin\php\php5.6.25\ext\php_xdebug-2.5.1-5.6-vc11-x86_64.dll
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
Hope this helps
Yeah, check network/port stats. In my case I'm using vmware fusion on mac, and the process vmware-natd was hogging the cpu (blocking on an open port I'm assuming), which I didn't notice. php.ini was completely fine, had to run this to get it to work again:
sudo "/Library/Application Support/VMware Fusion/boot.sh" --restart
So ppl check your php.ini (or xdebug.ini) file first. If it looks ok ala this discussion, then check that you're not having networking issues.
I don't know this means to you anymore or not! But, did you hit to a PHP file (anything.php) with right debug parameter, something like XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=12882809194391.
People often make mistakes to hit a HTML file with the debug parameters which causes Eclipse to hang at xdebug session
I had a similar problem and it turned out I was using the wrong dll. Hope that helps someone in the future.
I had the same symptom. However, my problem was that I set
xdebug.remote_host = ""
I did this because I'm using apache virtual hosts to eliminate the need for localhost. However, I had change it back to
xdebug.remote_host = "localhost"
and then change my apache/etc/hpppd-vhosts.conf to have localhost point to my root c:\web.
For me, these symptoms were caused by the windows firewall (Win7 Pro). I needed to explicitly allow eclipse to pass the firewall. I did this via the dialog at "Control Panel\All Control Panel Items\Windows Firewall\Allowed Programs".
It might not be useful to everybody, but... when trying to debug remote hosts, always remember the DSL router! (or any router along the way) I spent hours trying to find a solution, when I noticed that all I had to do was to activate port forwarding (port 9000) on my Linksys and everything worked like a charm :)
The above inputs were useful. I checked xdebug parameter values in phpInfo() and found that despite my settings to 1 or On, auto_trace and remote_enable were off. So i made it to true. And then remote worked!. Thanks.
Note, now you can launch the remote debugging session from within Eclipse by configuring various Debug configurations OR/and whenever you launch your such configured application outside Eclipse, you will get a question at Eclipse to accept or not to accept the debug session. So if you are on a different machine than of the eclipse UI you might find that the call to your application is getting timed out for no reason. Actually there would be a yes - no dialog box wherever the Eclipse session is
This thread helped me sort out my issue with MAMP on OSX with Eclipse. After upgrading to MAMP 2.1.1 from the 1.x release, I was not able to get xdebug to work in eclipse. It was hanging at the 57% level.
phpinfo showed that xdebug extension was loading fine and there were no errors in the PHP or Apache logs.
I only wanted to debug locally but the reason for the issue was that remote debugging was not enabled. Adding xdebug.remote_enable=true to the MAMP PHP.ini template and restarting MAMP solved the issue.
In my case CLI application was working fine, but it was the web application which was getting stuck at 57%.
It worked after 2 changes:
made server debugger as XDebug
Auto Generate URL true.
If Netweaver/Eclipse fails to connect to XDebug, you may wish to check the Apache logs for occurrences of something like: Cannot load Xdebug - it was built with configuration API220090626,TS,VC6, whereas running engine is API220090626,TS,VC9
[Fri Jun 01 18:38:05 2012] [notice] Child 3404: Child process is running
To remedy this, pick the right version of the XDebug binary from the XDebug website (try a few combinations till you get it working)
Before eclipse setting, Check out the following content is visible in phpinfo function.
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
I too encountered the same problem. I double checked all the settings in php with the output of phpinfo() and everything was fine.
Allowing Java(TM) Platform SE binary through the firewall did the trick.
Check out the commands from this question, they are very useful for debugging!
I've tried every possible solution on this post to get xdebug to work on a site running on Apache (http port 8000) to no avail. I then accidentally noticed that xdebug was working on another site that I had running on port 80. As soon as I changed the other site to port 80, it finally allowed me to debug it.
I wonder if there's a setting that can direct Apache to allow xdebug on other ports than just 80. I have more than one site running in Apache and would like to debug each of them without having to reconfigure the ports. Anyone had this issue before? or knows how to fix it?
If your configuration is ok, just delete the file :
YOUR_WORKSPACE/.metadata/.plugins/org.eclipse.core.resources/.root/.markers
Had same issue using Uniserver Zero XIII 13.2.0 (requires MS VC12 redistributable install) and Eclipse Neon Release Candidate 3(4.6.ORC3). Our website uses phalcon, when we found an issue with the phalcon.dll and php7.0 we dropped back to php5.6. We verified xdebug settings above, added zend_extension=$(US_ROOTF)/php56/extensions/php_xdebug.dll--would not connect, no break points.
Found a warning at top of Eclipse Dialog Project | Properties | PHP | Debug | Configure Workspace Settings... | PHP Executables | PHP56(Workspace Default) | Edit | Debugger | "XDebug extension is not installed. Please visit http://xdebug.org...". This made us suspicious of the version of the php_xdebug.dll (2.5.0) in the Uniserver 13.2.0 php56. I downloaded php_xdebug-2.4.1-vc11.dll, dropped it in /php56/extensions and PRESTO! Eclipse PHP Debugger works!
Here is another blog which mentions how to verify if Xdebug is properly installed or not via the command line
http://allcodeverything.blogspot.com/2012/07/code-debugging-with-xdebug-and-eclipse.html
It mentions this
If you want to figure out if everything worked well, here is a nice piece of code that you'll run through the CLI (command-line interpreter, basically outside of Apache or a browser; just pure PHP) after you have typed the following in your browser: "http://localhost/dbgtest.php?XDEBUG_SESSION_START=ceable"
<?php
$address = "localhost";
$xdebug_port = 9000;
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
socket_bind($sock, $address, $xdebug_port) or die('Unable to bind');
socket_listen($sock);
$debug_client = socket_accept($sock);
echo "connection established: $debug_client";
socket_close($debug_client);
socket_close($sock);
?>
The command-line window should print something like "connection established: Resource id #5".
I have recently tried to get going with Netbeans 6.5 after it rated so highly in the IDE review by Smashing magazine. http://www.smashingmagazine.com/2009/02/11/the-big-php-ides-test-why-use-oneand-which-to-choose/
My main reason for switching from Notepad++ is that I'd like to be able to debug my code and set through it.
I have followed the instructions about how to install xdebug from both the vendor http://xdebug.org/ and the netbeans web site. http://www.netbeans.org/kb/docs/php/debugging.html#gettingReady but to no avail.
How is it done, has anyone else got debugging working in netbeans?
(My setup is: Windows XP, Wamp server 2.0, PHP 5, Netbeans 6.5.1)
It's important to add this line in the php.ini:
xdebug.idekey="netbeans-xdebug"
Note: In NetBeans go to Settings and look where the xdebug stuff is set up. Look for that Session ID. In my case it was netbeans-xdebug.
hm, for me, the netbeans was the first ide that php debugging was working out of the box.
Does the xdebug show in phpinfo? if it does it should work with default settings. the only one that is needed is:
xdebug.remote_enable=on
So if this isn't enabled put it in your php.ini file, restart apache, and debugging should work.
If not, you will have to supply more info for me to help you.
sy
I have since found that WAMP, when installed with Mod_rewrite and cURL cannot cope with Xdebug.
It is a known error and crashes everytime.
http://phphints.wordpress.com/2008/10/24/wampserver-phpini-settings-for-use-with-xdebugdll-pear-and-silverstripe-cms-framework/
Unfortunately, I am using these 2 libraries too.
It's not a know problem that xdebug gives issues with curl or mod_rewrite. The only issues I am aware of is with Xdebug on Vista.
You can see here:
http://ruilima.com/2010/11/ambiente_de_desenvolvimento_php_netbeans_xdebug/
is in Portuguese, but there is a pre configured virtual machine with Ubuntu 10.10, netbeans, php, mysql, xdebug, ready to use. take a look
I found out that in Netbeans you need to set the webroot path in the projects to app/webroot. If you do this debugging works flawlessly.
If you are using xampp under Windows:
You only need to open your php.ini file and change these two lines
;xdebug.profiler_enable = 0
;zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
into
xdebug.profiler_enable = 1
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
(Caution: If your xampp version is old, you must download it from http://xdebug.org/download.php, download the 32 bit even your OS is 64 bit. E.g. the xdebug's name you downloaded is php_xdebug-2.2.1-5.4-vc9.dll. First copy php_xdebug-2.2.1-5.4-vc9.dll to the directory C:\xampp\php\ext\, then your the second line will be zend_extension = "C:\xampp\php\ext\php_xdebug-2.2.1-5.4-vc9.dll)
After that stop apache and start again, that's it.
If you're having the problem in which Apache decides to crash whenever you run the debugger (which is what I had and is extremely annoying). I'm fairly sure I re-installed xampp and re-set up xdebug. I think the problem was to do with the zend-debugger being set up weirdly in php.ini and me not modifying the correct php.ini.
Eventually after re-installing and resetting it up I got it working fine.
I now run a dev release of Netbeans which has networked debugging with xdebug so we run it all off of our development server and it works a treat.
Good Luck, There isn't particularly any decent documentation on how to set up xdebug with net beans.
I have had occasional issues with NetBeans and XDebug which have been down to a Watch statement being in place which does not relate to the code being debugged.
In this case the debugger just fails with a Socket Exception.
Remove any watches if you find this is causing your issue. Generally though I have found XDebug to be extremely handy!
I do realise however that this may not relate to the issue you have here but it's worth being aware of.
found the solution of the same problem on the same site PHP Netbeans: xdebug stops on every include() or require()
Well wrongdoing was, forgetting
[xdebug]
as a section header in php-ini. And of course, "park" your stuff right before another section start (e.g. [Date] or [iconv]) otherwise you will accidetenly place those in the wrong section. (In the comment djungle of php.ini this happens easily.)
In my case it was a process running on my machine (Windows 7) that was using port 9000 already called aeagent.exe
I changed my php.ini setting to "xdebug.remote_port=9001", made the corresponding change in netbeans, then restarted Apache. Now it works.
Thanks to SysInternals TCPView tool.
Go to http://wiki.netbeans.org/HowToConfigureXDebug . There is a big list of steps you should follow, that might help you out.
But most likely you just need a new version of xdebug-binary. Go to http://xdebug.org/wizard.php to find out what binary you need und your problem might be solved.
When running netbeans under Ubuntu, I was facing this issue too, it seems that I have tried all solutions found in internet but all in vain.
The only thing that finally helped was running netbeans with SUDO command! Looks like regular user didn't have permission to listen on port 9000 (or any other).
sudo netbeans &
...and voila, I can debug again! Maybe it'll save you a day or two
Now its working after Wasting the 3 hours for making xdebug work on Windows8 with wamp 2.2
replacing original lines below [xdebug] with following
zend_extension = "c:/wamp/bin/php/php5.3.13/zend_ext/php_xdebug-2.2.0-5.3-vc9.dll"
;make sure path of your own php_xdebug, dll version may vary.
[xdebug]
xdebug.remote_enable = on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
;recheck your port number in netbeans [Tools=>options=>php=>debugging there it is: debugging port]
xdebug.profiler_enable = on
xdebug.profiler_enable_trigger = on
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
Now click on wamp icon in taskbar and "restart all services"
Well..Now final step>>START NETBEANS AS ADMINISTRATOR
Holly soul of windows8 i hate you :<
Go through the below document for remote debugging using NetBeans.
http://stuporglue.org/setting-up-xdebug-with-netbeans-on-windows-with-a-remote-apache-server/