xdebug and MAMP horror show - php

i have been using MAMP PRO and xdebug for years (through Netbeans) and suddenly I am unable to debug. I have narrowed the issue down to the following. Whenever I append the parameter XDEBUG_SESSION_START=anyvalue to the localhost url the page freezes, and obviously, Netbeans just waits for a connection.
for example, the following url works fine:
localhost:8888/index.php
this url freezes:
localhost:8888/anypage.php?XDEBUG_SESSION_START=netbeans-xdebug
I have tried:
-closing all copies of Netbeans.
-restarting MAMP PRO.
-restarting the Mac.(Mavericks)
-deleting MAMP temp files in /Applications/MAMP/tmp/php
-creating a new MAMP host ..ex localhost1
nothing seems to fix the problem. There is nothing wrong with the php.ini file, or Netbeans config, or xdebug config. I am desperate.
To be clear, when i restart the computer, start MAMP PRO and nothing else (Netbeans is not running), then go here in ANY BROWSER---
localhost:8888/anypage.php?XDEBUG_SESSION_START=netbeans-xdebug
the page does not load and just waits.
other examples the following DOES load
localhost:8888/anypage.php?XDEBUG_SESSION_ST=netbeans-xdebug
the following DOES NOT load
localhost:8888/anypage.php?XDEBUG_SESSION_START=netb
what is blocking the connection when the get parameter "XDEBUG_SESSION_START" is added??? I am ready to give up.

Fixed this by changing one line in the php.ini file from:
xdebug.remote_host=localhost:8888
to:
xdebug.remote_host=127.0.0.1:8888
I have no idea why it worked with localhost for years, and all of a sudden did not. I suspect the installation of Xcode, but cannot prove or disprove.

Related

Localhost MAMP does not get file contents from external webpage

I have installed MAMP version 5.5 and am using PHP 7.3.8.
I have switched on the allow_url_fopen = On in the php.ini file in the MAMP application
(MAMP/bin/php/php7.3.8/conf/php.ini)
I have tested to fetch the localhost like:
file_get_contents("http://localhost");
which works fine.
How ever as soon as I am trying to get external page the page is loading at snails pace and the it tells me it's timed out.
for example:
file_get_contents("https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=".$origin."&destinations=".$destination."&key=".$api"")
I have the feeling it is something in the MAMP settings as this seems to work on a live server.
Any help welcome

Apache in MAMP Pro 4 has stopped working, refuses to start

Have been using MAMP Pro for a fair while - version 3 primarily, upgraded to 4 a while ago.
I haven't had any unusual issues at all, but today the Apache service failed to start, telling me to check the error logs. The logs were blank unfortunately... I've made no system configuration changes, no changes to MAMP/MAMP Pro. Shut down my system yesterday, started today, it no longer works...
I've tried numerous suggestions found via Stack Overflow and Google without any success.
Even after completely uninstalling and re-installing MAMP Pro I am unable to get the service to start.
Nothing appears in the logs...
When starting it manually on the command line it comes up with a PHP related error:
$ Applications/MAMP/bin/apache2/bin/apachectl start
httpd: Syntax error on line 135 of /Applications/MAMP/conf/apache/httpd.conf: Cannot load /Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so into server: dlopen(/Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so, 10): image not found
The confusing thing is that I don't have PHP 5.2.17 specified anywhere, at all - according to MAMP Pro it should be using PHP 7.0.12.
If I add PHP 5.2.17 to MAMP using the appropriate MAMP Pro dialogs, Apache still fails to start via the MAMP Pro interface. I can now start it manually from the command line however, but none of my virtual hosts/etc seem to be loaded.
apachectl -V tells me it's using /Applications/MAMP/conf/apache/httpd.conf, but there is nothing in that file that has any reference to any of the configs generated in /Library/Application Support/appsolute/MAMP PRO/conf
It also looks like hosts entries aren't added to /etc/hosts.
Even if I tell /Applications/MAMP/conf/apache/httpd.conf to do nothing but include /Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf (and manually add entries to /etc/hosts) it still doesn't seem to work at all...
I and my colleagues are at a complete loss, especially given it was working yesterday...
Has anyone had any issues like this?
I managed to fix the similar issue you had.
My Apache server was working fine and then following updating to 4.0.6 I experienced similar issues.
There were 2 things I did to fix the issue. I was getting the same error where it couldn't find a php file in 5.2.17. After fixing that by adding 5.2.17 to MAMP I experienced an apache error regarding user permissions.
(22)Invalid argument: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
File > Edit Template > Revert ALL Templates to Default Settings.
Save & restarted the servers and all worked finally and all my hosts had retained as well.
I had previously entered a custom line in my httpd.conf file that for countless versions had copied across fine however it looks like the folder structure had changed and so couldn't locate it causing the unusual error about User permissions. I have since re-entered the custom line with the correct structure and all working fine again.
Hope this helps.

Cannot open phpMyAdmin setup wizard

While setting up MySQL I've got dozen of headaches, but nothing hurts as much as this one. I've been bashing my head around trying to install phpMyAdmin, followed all kinds of tutorials (they pretty much all said the same) but if something can go wrong it probably will.
When trying to open the setup wizard(from browser) by going to localhost/phpmyadmin/setup/index.php (Step 4. in tutorial below, part when trying to invoke setup wizard) I get "Web page not avaiable" thing. Now when i just type localhost/ in browser I get the "It Works!" page.
I've followed the steps from tutorial, and it all worked (until step 4). Also installed Apache and MySQL with their reference tutorial at beginning(worked without any problem)
From what I've got I assume apache is set-up correctly since it shows "It Works!" page, but somehow it cant access the rest of the path phpmyadmin/setup/index.php
What did I do wrong?
Tutorial I followed:
http://www.thegeekstuff.com/2010/09/install-phpmyadmin/
Some basic info you might need:
PHP 5.5.3-1ubuntu2.6 (cli)
MySQL 5.5.37-0ubuntu0.13.10.1 (Ubuntu)
Apache2 Apache/2.4.6 (Ubuntu)
phpMyAdmin 4.3.6-all_languages pack from their website(extracted to /usr/local/apache2/htdocs/phpmyadmin )
OS: Linux Mint 16 32bit
Browser: Chromium
Check your php.ini file and see if it's there.
extension_dir = "ext"
If its there just specify the full path to your extension directory.
extension_dir = "C:\php\ext"
According to me this will make this error solved.
Hope this helps you

Cannot Start Wamp Server

For some unknown reason I cannot start WAMP server - The icon stays yellow no matter what:
Checked port 80, and it's not used.
No Skype, no Firewall.
Tried MANY solutions I suggested here in stackoverflow - absolutely nothing.
Tried to uninstall and reinstall - it worked for 10 minutes, then it didn't work again.
The only thing I'm changing is to include Virtual Hosts under httpd.conf. Checked every solution I could find on the net - nothing is working for me.
Maybe, just maybe it's because I previously installed PHP 5.5 apart from WAMP? If I go to PHP > PHP Extensions > then I can see there's a problem in php_opcache and php_enchant. When I click on them I get an error message that says: Could not execute menu item (internal error). [Execption] Could not perform service action: the service has not been started. The PHP Version I installed is 5.5.15. The PHP WAMP is 5.5.12... I don't have a clue how to uninstall PHP, and I couldn't find anything about that on the net.
PHP Error log says: PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - %1 is not a valid Win32 application. in Unknown on line 0
EDIT - It seems like the cause for the problem is me trying to include Virtual Host via httpd.conf file. When I excluded, like in default, WAMP is online again. Any suggestion of how to include virtual host and still get WAMP get online?
It looks like you're running on a corrupt install have you tried reinstalling the software?
Alternatively i would recommend using Xampp which basically offers the same service as Wampp only with a bit more ease of access (also allowing for Mecury mail service and an FTP server for remote access).
The problem with php_intl can be corrected easily, see this answer
In order to find out what Apache is complaining about with the Virtual Hosts definition look at the Windows Event Log or, launch a command window and
cd \wamp\bin\apache\apachex.y.z\bin
httpd -t
This should give you filename and line number where your errors are.
Try changing that port number anyway. Mine stays yellow if the port number is set to 80, even though WAMP says it's not being used by any other program.

wamp cannot load mysqli extension

WAMP installed fine, no problems, BUT...
When going to phpMyAdmin, I get the error from phpMyAdmin as follows:
Cannot load mysqli extension. Please check your PHP configuration
Also, phpMyAdmin documentation explains this error message as follows:
To connect to a MySQL server, PHP needs a set of MySQL functions
called "MySQL extension". This extension may be part of the PHP
distribution (compiled-in), otherwise it needs to be loaded
dynamically. Its name is probably mysql.so or php_mysql.dll.
phpMyAdmin tried to load the extension but failed. Usually, the
problem is solved by installing a software package called "PHP-MySQL"
or something similar.
Finally, the apache_error.log file has the following PHP warnings (see the mySQL warning):
PHP Warning: Zend Optimizer does not support this version of PHP - please upgrade to the latest version of Zend Optimizer in Unknown on line 0
PHP Warning: Zend Platform does not support this version of PHP - please upgrade to the latest version of Zend Platform in Unknown on line 0
PHP Warning: Zend Debug Server does not support this version of PHP - please upgrade to the latest version of Zend Debug Server in Unknown on line 0
PHP Warning: gd wrapper does not support this version of PHP - please upgrade to the latest version of gd wrapper in Unknown on line 0
PHP Warning: java wrapper does not support this version of PHP - please upgrade to the latest version of java wrapper in Unknown on line 0
PHP Warning: mysql wrapper does not support this version of PHP - please upgrade to the latest version of mysql wrapper in Unknown on line 0
So, for some reason PHP is not recognizing the mysql extension.
Anyone know why? Any solution or workaround?
I deleted the PHP in program files ad everything started working , the problem that there two installations of pHp
I tried many solutions, and none worked for me. I tried the following solutions:
Restart wampserver
Reinstall wampserver
restart machine
and all other solutions mentioned in this question.
However, none of these worked. Then I found that my PHPMyAdmin was not working in chrome and was working in firefox. So I tried clearing cache, restarting browser etc, but still it would not work.
Then I deleted all the files from C:\wamp\tmp and then tried again, and it works. I am not sure why it works, but here is what I think. The session was cached and not getting cleared. So as soon as I deleted all files in this directory all the sessions were deleted and hence it worked fine.
First, make sure that the php.ini file is loading the mysqli extension.
If you are using WAMPServer, click on the icon in the system tray, go to PHP -> PHP Extensions and make sure it is checked. If not, go into the php.ini file and make sure that the line: extension=php_mysqli.dll is uncommented (eg, remove the ; if it exists). If that line does not exist, add it.
If this still does not work, double check that the right php.ini file is being loaded.
To do so, view your phpinfo() (Here for WAMPServer). Scroll down to the Loaded Configuration File row and see which php.ini is being loaded.Make sure it is the right file. If you're using WAMPServer, it should be(WAMP INSTALL FOLDER)\bin\apache\Apache2.2.11\bin\php.ini. By default, it isC:\wamp\bin\apache\Apache2.2.11\bin\php.ini`.
If a different php.ini file is being loaded, just rename it to something else so that PHP will try and find the file somewhere else. There should be a way to specify which on eyou want to use, but I forget exactly how to do that...
If this still doesn't work... Try messing around with phpMyAdmin's settings, or using another answer, but I'm afraid I can't help beyond this.
I was running WAMP with two PHP versions 1) 5.2.9 and 2) 5.2.13.
As per site requirement i needed to change PHP version to 5.2.9 from 5.2.13. after swapping PHP version, error was "mysqli extension is missing". after debugging long time i get to know it was due to wrong "extension_dir" path in php.ini file.
So i changed its value:
Old: "extension_dir" c:/wamp/bin/php/php5.2.13/ext/
New: "extension_dir" c:/wamp/bin/php/php5.2.9/ext/
Restarted All services in wamp server, then it's fixed.
I had the same problem. I had WAMP server installed. All was working fine. Then one day I restarted my computer and it just stopped working! I tried desperately going through all help posts and doing them but nothing worked.
What they usually suggest you do is, first go to your php.ini file and make sure your 'extension_dir' is properly set. Then to make sure these two lines are not commented (remove the ; infront):
extension=php_mysql.dll
extension=php_mysqli.dll
Then some suggested that I download fresh copies of these two files but none worked. I also tried uninstalling everything (php/mysql/apache) and reinstalled fresh copies of WAMP server several times but with no luck.
Finally I managed to find an alternative solution. I switched to 'easyphp' (http://www.easyphp.org/). This is something very similar to WAMP. First I made backups of my sql databases so I can reload them on the new installation.
Then I installed 'easyphp' and everything seems to work fine. I reloaded my sql databases from my backup and now things are back to normal.
I hope someone suffering from a similar prob. will find this useful. If someone has really found a fix to make WAMP server work. Pls do be kind enough to post it here so many will benefit.
in wampserver go to php.ini. open the file and uncomment extension=msql.dll by removing semicolon(;) for respective operating sytem.
Just add in your php.ini:
[PHP_MCRYPT]
extension=php_mcrypt.dll
[PHP_MYSQL]
extension=php_mysql.dll
[PHP_MYSQLI]
extension=php_mysqli.dll
Also setup the mysql password:
SET PASSWORD FOR root#localhost=PASSWORD('your_password');
And the phpmyadmin mysql password in config.inc.php:
$cfg['Servers'][$i]['password'] = 'your_password';
Had the same problem, with wamp. Try to exchange your current version of php.ini with a backup. There is one in: wamp\bin\php\php5.3.0phpForApache.txt. Worked for me.
Just wanted to chime in on this one. Using Wamp Server 2.0, and using Zend Studio with Zend debugger for development.
I wasn't able as of yet (will get back to it at some point) to get the zend debugger working with php 5.3. So in wamp I loaded an earlier php version, 5.2.11. I was getting the same error when acessing php my admin.
What I had to do was change the php.ini file value for "extension_dir" to c:/wamp/bin/php/php5.2.11/ext/ to match the version of php I was using. After that it was all good.
I had this problem and spent 2 hours trying all the solutions online, none worked.
Tried this, and it woked:
Change
mysql.default_host =
to
mysql.default_host = localhost
and restart WAMP. pay attention if you are using mysqli or not.
I had the same error. When I increased the script memory size and enabled E_ALL then restarted the server, I got that error in phpmyadmin. All I had to do to fix it was restart my computer!
I got this problem for a long time. Tried all I've read on forums and this finally worked for me:
Open your php.ini (I assume you've got the good one that is loaded...) and find this line
mysqli.default_port = 3306
change for
mysqli.default_port = 80
Restart all services
Go to localhost/phpmyadmin -> won't work
Reopen the php.ini file and retype this
mysqli.default_port = 3306
Restart all services
Worked for me.
For me worked this, after searching all logs/internet/every non-normal things.
You have to register dl by:
Through application:
WAMP -> PHP settings -> enable dl
or
# php.ini #
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = On
I have just installed WampServer, and faced same problem. I have found solution, that works for me, it is ridiculously simple.
Disable PHP extension php_mysqli.
Restart WampServer, visit local phpmyadmin.
Enable php_mysqli back.
Repeat step 2.
After few page refreshes, remaining errors plates (about MySQL and sqli) had gone.
i tried hard by
installing the wamp again and again,
by checking the php.ini file,
by restarting the machine,
by replacing the index.php file,
but none works.
then i go to the wamp/temp and deleted all files and it works fine now.
I had path variable in windows set to some random version of php.
The fix was to update it and set it to the folder within my wampserver installation:
C:\wamp64\bin\php\php5.6.38
Then I realized this is wrong also for my specific case, and I should actually be running the script from within vagrant. Live and learn.
I had this issue because of a different reason:
Check the PHP Error Log(Get from the Wamp Tray -> PHP -> PHP Error Log.
I had a syntax error in the php.ini file while I was editing the file.
Check the log and clear the error. This will open your PhpMyAdmin properly.
Check your phpForApache.ini file's extensions. This file should be same as your php.ini file.

Categories