wamp php CLI has stopped working - php

I installed wamp server 2.2 with php 5.3.10 and apache 2.2.21. But when I want to execute some symfony command the response from my Windows 7 Home Premium is:
php -> CLI has stopped working

I had this error for a long time. It turned out I was on a slightly older version of Xdebug (php_xdebug-2.2.0-5.4-vc9.dll).
I replaced that file with "php_xdebug-2.2.2-5.4-vc9.dll" and it magically started working immediately.
I'm on wamp, and I updated both php.ini files (one is for cli, one for normal use) with the latest filename.
"zend_extension = c:\wamp\bin\php\php5.4.3\ext\php_xdebug-2.2.2-5.4-vc9.dll"
Then dropped the new file into the php ext folder and instant success. Hope this helps.

Related

Using php 7.3.4 64bit with a 64bit oracle client and php 7.3.4 32bit with a 32bit oracle client on the same server

We have an IIS on our Windows Server 2016 Standard which use via fast cgi a php 7.3.4 32bit.
To build a connection to a oracle 12cR1 database on another server we use the php_oci8_12c.dll and the oracle client 12.1.0 32bit.
This works fantastic. Now we want to switch to php 64bit, but for some old projects we still need the 32bit php and oracle client.
So we do the follow:
1. Uninstall the oracle client
2. Install oracle client 12.1.0 64 bit (install type: administration) in C:\Oracle\product\12.1.0\client_x64
3. Restart server
4. Configure the net manager
5. Install oracle client 12.1.0 32 bit (install type: administration) in C:\Oracle\product\12.1.0\client_x86
4. Restart server
5. Configure the net manager
6. Download php 7.3.4 64 bit with the 64 bit extensions
Now we have two php folders:
C:\php7_3_4_x86
C:\php7_3_4_x64
At this time the IIS use the C:\php7_3_4_x86\php-cgi.exe and the 32bit oracle client, because its the latest installed client and the path is the first of all paths in the PATH variable.
Now we want to switch temporary to 64bit. So we try the follow steps:
1. Change in IIS handler to C:\php7_3_4_x64\php-cgi.exe
2. Swap the oracle clients path in the environment variable PATH. Now its: C:\Oracle\product\12.1.0\client_x64;C:\Oracle\product\12.1.0\client_x86;[...]
3. Restart the server
After restart we try to open a php file in browser, but we get the follow error:
Call to undefined function oci_connect
If we put the oci.dll from C:\Oracle\product\12.1.0\client_x64\BIN directly into the C:\php7_3_4_x64 it loads the file. So we think it cannot find the 64bit client.
We also try the method with create a link in C:\Windows\system32 / SYSWOW64, but this doesnt work. Same error.
What could we do? We need the possibility to switch between 32&64bit php+oracle.
Problem solved.
Everything was correctly, but the oracle setup forgot the correct windows right for the clientx64 folder.
At the clientx86 the group "authenticated user" (in german: Authentifizierter Benutzer) has full access, while the clientx64 doesnt have this group.
After adding the group and give it full access to the clientx64 folder it works. It isn't necessary to switch the entries in the PATH variable. PHP try to loading the first element and after failing it loads the second element in PATH variable.
So everything works!

Cannot make Imagick detect supported format on Windows + PHP 5.6 (Xampp)

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.

EasyPHP Devserver 16.1 Curl Win 10

EasyPHP don't start.
When clicking on start server or start DB nothing happens.
No error logs whatsoever....
I had a lot of trouble to make this all work.
First I had to get rid of all old Easyphp versions!
Make sure you have the right runtimes installed, both x86 & x64 if you have a 64bit system!
I had to shutdown Malwarebytes Anti-Malware, EasyPHP wont start if this is running, you even can get a Riskware message from it!
After all this I could get EasyPHP 16.1 to start, now I needed to activate Curl.
Follow all instructions I could find here.
Copied libeay32.dll, libsasl.dll, ssleay32.dll from php dir to c:\windows\system, c:\windows\system32 and even to c:\windows\sysWOW64.
removed the ';' from the 'extension=php_curl.dll' line in all three ini files in both php dirs.
But the trick that finally make Curl worked for me was to add the path to each php directory to the global 'Path' variable via (rightclick startmenu)System->advancedsettings->globalvars, dubbelclick on 'Path' and add the complete path to your php dir, one line for each php dir!
Maybe not every step is needed for you but for me this finally worked. If you still have trouble then maybe there is some antimalware or antivirus program running what for some reason stops EasyPHP from running!.
There are so many questions about this so I decided to put this in here as it is.

Debugging PHP codes

I am following this tutorial
STEPS
Downloaded Xdebug - PHP VC 11 64 bit [Didn't download TS version - ]
My php is 5.6.11 vc 11
Added zend extensions with right dll path
Started server. Zend extension is added. Checked with phpinfo()
Downloaded Eclipse PDT
Opened Eclipse and created new project and given path to my files
Localhost server so didn't change PHP->Servers
Debug configurations
Changed server to XDebug
Added a file to debug
Started the server. It opens in mozilla [I changed default web browser to mozilla in eclipse]
But it didn't stop at my breakpoints
<?php
$x = 2;
$y = 5;
$z = $x + $y;
echo $z;
?>
Did I miss any step? Or is there any other way to achieve debugging PHP?
Any Suggestions?
Make sure you have the correct version of the XDEBUG dll to match your Apache/PHP installation.
If you have PHP installed as an Apache module you need the Thread Safe XDEBUG dll. If you have PHP installed as CGI/FastCGI then you want the Non Thread Safe XDEBUG dll.
Its a good idea to use the XDEBUG Wizard
That will tell you exactly what to modify in your php.ini and which dll you should download.
Beware of old tutorials, they may suggest using the old and now defunct zend_extension_ts= when you should use zend_extension=
Also on windows systems use the unix forward slash and not the dos backslash in the path to the XDEBUG dll like so :-
zend_extension="C:/server/php/ext/php_xdebug-2.3.3-5.6-vc11-x86_64.dll"

NFS doesn't sync files if characters are modified in a file

I'm having a strange problem with my vagrant setup: changing characters in a file and saving it doesn't reflect the change in the vm. But if I add/remove some characters or add in a few blank links, everything works fine.
I have already checked if I have opcache enabled on my PHP5.5 and "php -i | grep opcache" get any result ... so I imagine it's no.
Already tested too another vagrant (1.7.2) version, same result.
My configuration is :
Windows 7 Pro
Vagrant 1.6.3 with plugin WinNFSd
VirtualBox 4.3.12
Centos6.5 Box
PHP 5.5.19
Apache 2.4.10
PhpStorm 8 (but problem is same with SublimeText 3 and Notepad++)
Here is a video of a test from me for show you the problem :
https://www.dropbox.com/s/k70fiwfw6mopjs7/2015-03-24%2020-47-07.mp4?dl=0
Two weeks I work on this problem, it will make me crazy ...
I already tried Rsync and Samba or default vagrant synch folder but it doesn't meet my needs.
I really appreciate your help guys!
The problem on sublime was atomic_save setting being true. Not sure if there is an equivalent setting for PHPStorm/Notepad++
https://github.com/mitchellh/vagrant/issues/3888

Categories