Can't get MAMP to load xdebug (phpinfo()) - mamp

MAC OSX 10.7.5 -- MAMP 2.1.3 -- XDEBUG 2.2.3
I used the xdebug wizzard to download and install using the terminal. After following the steps
Rebooted MAMP but no xdebug in phpinfo();
I thought it was weird that the wizzard says all you have to do it paste zend_extension = /Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so in the end of your php.ini file
I did add quotes around the pathname - the pathname from the wizzard came without them
Every other tutorial says there is more than just this one line that needs to be added
MAMP seems to have its own 'zend_extension = "/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"' that just needs to becommented out. Anyway I tried both the pasting from the wizzard as well as uncommenting.
Since I'm trying to use xdebug with my PHPstorm trial, I checked for the steps layed you at http://www.dotvoid.com/2012/09/using-xdebug-in-mamp/
Again it's weird: Here it says that all you need to do it add these 2 lines
xdebug.remote_host=127.0.0.1
xdebug.remote_enable = 1
It's weird because other tutorials make you add more lines (back when I tried to get xdebug on an older version of MAMP to go with netbeans without success) about the localhost.
Here's what's in my php.ini file now:
[xdebug]
zend_extension= "/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1
I also checked if I'm configuring the right php.ini file, looking in phpinfo(); where it says which php.ini file is loaded. In this case /Applications/MAMP/bin/php/php5.4.10/conf/php.ini I verified if this is the correct php.ini file that I'm edititing and it is.
The last anwser in this SO question here speaks of two certain files that need to be the same binary maybe one file is 32bit binary and the other one is 64bit. When I tried to check this, the files mentioned in that question (/path/to/mamp/Library/modules/php5.3/libphp5.so) are not in my current installation of MAMP. In my current installation, I can go to Applications/MAMP/Library/modules, but there is no folder in that modules folder, leave alone one that says php of any sort.
In this tutorial, there is a mention of updating PEARL. This may not be relevant to my issue but I just followed it because I don't know really, I thought it wouldn't hurt. When I try to do that in my terminal the error message says
Xdebug requires Zend Engine API version 220090626.
The Zend Engine API version 220100525 which is installed, is newer.
Contact Derick Rethans at http://xdebug.org/docs/faq#api for a later version of Xdebug.
I found this issue in the xdebug FAQ. I quote
it is most likely because you compiled Xdebug against PHP headers that belong to a different PHP version that you're running
Further explanation confirms that the message about the zend api version points to the same issue and that two versions of PHP are colliding somehow.
The solution to this is explained on the same FAQ page where it says
Q: How do I find which phpize to use? [...]If it doesn't match up, and perhaps the wrong "phpize" binary is found on the path, you can
run configure as follows:
1. /full/path/to/php/bin/phpize
2. ./configure --with-php-config=/full/path/to/php/bin/php-config
I don't know how to interpret this in practice. But here's what I have tried
I was still in the /usr/bin and tried the first command usr/bin/phize. this returned Cannot find config.m4. Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
I don't know what they mean by the top level source directory of the module. Maybe 1. and 2. are 1 command? And the module means xdebug.so?
No matter what I try though, I keep getting the Cannot find config.m4 error whenever I just even try to run phpize. I tried running phpize from /usr/bin/phpize or from /Applications/MAMP/bin/php/php5.4.10/bin/phpize. Same error came

Related

Wamp Server 3.1.4 showing (environment variable PATH) error

I am getting environment variable PATH error from wamp server.
already set the path (C:\wamp64\bin\php\php7.2.10) in advance system settings but again getting the same error
Sorry,
There is an error.
There is Wampserver path (c:/wamp64)
into Windows PATH environnement variable: (C:\wamp64\bin\php\php7.2.10)
It seems that a PHP installation is declared in the environment variable PATH
C:\wamp64\bin\php\php7.2.10
Wampserver does not use, modify or require the PATH environment variable.
Using a PATH on Wampserver or PHP version
is detrimental to the proper functioning of Wampserver.
Press ENTER to continue...
see the picture below:
how to resolve wamp server (path) error
The error is telling you that you have set the windows path to contain a folder to a version of PHP. WAMPServer does not need and does not like to have the PATH set to any version of PHP whether it came with WAMPServer or was installed some other way. It is all in the message on the Command Window.
So to remove the error, remove all references to any PHP you may have anywhere on your system from your PATH environment variable, regardless of whether it came with WAMPServer or was installed some other way.
The reason of course is that with WAMPServer you can have many versions of PHP installed into WAMPServer. If you notice it comes out of the box now with more than one version of PHP ready to go.
The Reason
If you add ONE of those PHP versions to the PATH, then when you switch to another version of PHP your PATH would still be pointing to the old version. You will undoubtedly forget to amend the PATH, and this will just cause confusion and issues, so we prefer you not to have any version of PHP on the path at all.
The PHP CLI
Ok so now you have no version of PHP on your path how will you run the PHP CLI (Command Line Interface) I hear you ask :)
To do this I have a little .bat/.cmd file that I place in a folder that is already on the Windows PATH so I can run it form anywhere.
I have already written that up in this answer to a previous question, so follow this link rather than me writing it all up in 2 places.

Magento 2 can not log into Admin after fresh install

I have successfully installed a Centos Vagrant box with Magestead (http://www.magestead.com/). This worked and I was able to log into the Admin section without any issues.
However, I am more comfortable using Ubuntu, so I created a new vagrant box using Ubuntu. I set it up as per the documentation and installed Magento without any issues. I have set up the correct file permissions etc. However, when I try and access the admin section, I receive the following error. The front pages work fine btw.
Warning: file_get_contents(/var/www/html/magento2/var/cache//mage-tags/mage---ea6_BACKEND_MAINMENU): failed to open stream: No such file or directory in /var/www/html/magento2/lib/internal/Cm/Cache/Backend/File.php on line 614
I have tried clearing the pub/static folder, cleared the various var/ directories as suggested in other posts etc.
Thinking it might be an issues with the vagrant shared folders. I started again and this time installed Magento on a folder inside the vagrant box (not on the folder share). This was a lot quicker so I hoped that this might have been the reason. Alas, this did not solve my problem and I still receive the same error.
I have tried the composer install and the manual compressed download install but I have the same error on both.
Looking at the location of the missing file, I can confirm that the file is not there. When I look at the Centos box, this file is there. If I remove the folder on the Centos box (var/www/html/magento2/var/cache/), the file gets created as expected and works fine. This does not happen with the Ubuntu box, however some of the mage---ea6 files are created so it's doing it stuff.
Does anyone have any ideas?
So I figured it out after some testing.
It turned out to be xDebug (or the way I was installing it) that was causing the issue. I ran some tests and the admin areas worked fine with xDebug not installed.
I needed Xdebug for development reasons so I installed it using Pear and Magento installed fine with everything working correctly!

unable to run php cli from the command line when xampp portable is installed in another drive

I have installed a xampp portable package on my drive D, added the php folder path inside it on the system environment so I would be able to run php basically anywhere from the command line. but when i try to check if its working by executing the "php -v" command, it runs but i get this following error/warning messages.
"Warning: PHP Startup: Unable to load dynamic library 'xampp-portable\php\ext[:any].dll - The specified module could not be found."
*the [:any] there just means some dll filename.
and i get a lot of that warnings with just varying dll filenames,
anyway, here's the catch. when i do change my current path in the command line to somewhere in drive D, and then run the same command "php -v" it runs smoothly.
so what configuration should i do to fix this problem?
by the way, i do the same with mysql, putting its bin directory path on the system enviroment, run it in both inside drive C and drive D. and it runs smoothly. so i guess this problem is only on php.
I've posted the same question in xampp forums and this is the answer that was given to me. I'll be quoting the answer as it was and give credit to the one who answere it.
XAMPP is very proud that it don't have to set any environment
variables or registry values.
What you want to do is not possible with XAMPP portable without
mapping to a specific Drive letter. All configurations in xampp
portable have relative paths, so if you want to use cli from a
different drive letter, php can be executed, but all extensions of
them throw errors.
I would install the full version of XAMPP, map it to the current drive
letter with help of the setup_xampp.bat file and use the XAMPP control
panel Shell instead of default command line (advantage: The XAMPP
control panel shell sets local include paths to the needed XAMPP
folders).
Works for me (i can even use pear, git, composer, and other cli
scripts with the Xampp Shell if correct integrated).
best wishes, Altrea
credits to Altrea
Open your php.ini file, replace all relative paths to absolute paths. Eg: \xampp\ to C:\xampp\

Using XDebug with Eclipse PDT & XAMPP

I cannot debug a PHP script as a script. It always terminates immediately after starting. I set up an Xdebug log in my php.ini, but it's completely unhelpful. Xdebug does show up on my phpinfo(), so I know it's loaded in Apache.
I can also debug code as a webpage (which provides no info on variables and will not stop on breakpoints though), so I know Eclipse has the proper server settings. Both debug options use the same PHP exe (the one installed with XAMPP, php 5.3.1 compiled with vc6 compiler). I made sure that the compilation of Xdebug matched these settings.
On a perhaps related note: I noticed that I could only load Xdebug with the zend_extension command, instead of zend_extension_ts even though my version of PHP is indeed thread safe? I have to admit I'm a little confused by that.
I also made very sure that wherever I could select "XDebug" in Eclipse, I did. I've followed two tutorials to no avail here. Anyone have any ideas? I've tried the version of Xdebug bundled with my XAMPP (2.0.6-dev) and I also downloaded a new .dll, version 2.1.
Thanks!
Excellent instructions for Setup XDebug on XAMPP and Eclipse
#user629300 Instructions are good for eclipse versions prior to 3.5 see the links to get instructions for version based instructions. Also Getting XDebug to work with apache xampp to debug php, has pictures with good explanations. They are a little stale though.
A summary of the details from the first link, assuming PHP > 5.3 (which hopefully everyone is running now!):
Make sure that your php.ini file contains the following:
[XDebug]
zend_extension={xampp-folder}\php\ext\php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
Remove any config entries under the [Zend] heading, particularly those starting with zend_extension
Configure Eclipse:
in Window -> Preferences -> PHP -> Servers, configure the PHP server to use XDebug, add the base URL and local web root
in -> Installed debuggers, configure XDebug to accept remote sessions
(optional?) configure the PHP executable to point to php.exe in your XAMPP installation
You should now be able to hit breakpoints in Eclipse by adding XDEBUG_SESSION_START to the query string of your URL, e.g. http://localhost/?XDEBUG_SESSION_START.
first download the dll for xDebug
then edit your php.ini file
zend_extension_ts = “C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll”
make sure the line is uncommented
restart apache
make sure you are editing the right php.ini file

Using zf-tool with xampp and Windows 7

I'm new to Zend Framework and i'm trying to do some tests on my local server. I use xampp on a Windows 7 pc.
So i downloaded the zend package who comes with a command line tool to setting up projects. Copied the folder with zf.sh on the hard-drive on the location C:\Program Files (x86)\ZendFrameworkCli\bin, than updated the system variables to make it work.
When i type in the command line "zf show version" i get an error by "php.exe". I guess this happens becouse php and apache are not installed on the OS but runs under xampp server.
So, there's any way to make it work with xampp? Thanx in advance.
You need to had the php executable path to you PATH variable. You can do this with the system icon in your configuration panel. You can also use a nice utility : RedmondPath ( http://sites.google.com/site/redmondlab/path)
After that, launch a command prompt and type php -v to make sure that all is correct.