Xdebug on ubuntu and phpStorm doesn't show any erros - php

So I am new in ubuntu and I installed LAMP and get it to work with phpsotrm properly. The only problem i have is that when i have errors in my code it doesn't show me any errors, just a blank page.
Now with phpstorm I manged to connect with xDebug and when I checked phpinfo() I found:
http://imgur.com/zZnAi7d
Here is the phpstorm connection:
http://imgur.com/ckrkeHp
I changed proper php.ini file and I added following line at the end of the file:
[XDebug]
;zend_extension="/usr/lib/php5/20121212/xdebug.so"
;xdebug.remote_enable=1
;xdebug.remote_port="9000"
;xdebug.profiler_enable=1
;xdebug.profiler_output_dir="<AMP home\tmp>"
Still noting is shown, not even in the console or in the page source. Is there any fix for this issue? I tried to search the internet but couldn't find anything.

Just follow those intructions:
Let PHP show all errors
It seems that you've got disabled showing any errors.

I am such a dummy it actually works just the certain errors that i was trying to simulated didn't really effect xDebug.
I am so sorry for wasting your time.

Related

Visual Studio Code PHP debugger doesn't stop on breakpoints while remote debugging

I'm using vscode php debugger extension with homestead laravel.
The problem is when i try to debug remotely this debugger doesn't stop at the breakpoints i spent quite long time to resolve this error but unfortunately couldn't find any solution that can solve my problem..
Here is my enviroment
phpinfo() :
Homestead.yaml :
php.ini from homestead :
launch.json :
Basically i followed this configuration and some others also i tried xdebug.remote_connect_back=1 which i found from this community but it doesn't work.
Any help would be appreciated 🙏🏻 thank you for reading.
--------------------------Edited-------------------------
One more thing about my situation when i set the breakpoints as everything it stops on nowhere which i can't see where it is with this error.
Every stepping throws that kind of error
--------------------------Edited 2-------------------------
I figured why those such files are not found. The pathMappings in the launch.json it was 'code' not 'Code' since i changed it that file not found error was gone but still it's pretty weird it stops on the breakpoints only when exception occurs so still i can't debug

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.

joomla freeze when install it?

i am trying to install joomla but it freezes , i used XAMP and i tried a lot of solutions , but they didn't help , and the problem still the same , i changed the xamp\htdoc\my joomla folder\installation\sql\mysql and i opened Joomla.sql file and replace the term "ENGINE=InnoDB" with "ENGINE=MyIsam" ,but didn't help me .
i also tried the following :
in php.ini file i made both output_buffering and display_errors equal to off
Output_Buffering=Off
Display_Errors=Off
and in xamp\htdoc\my joomla folder\installation\sql\mysql\Joomla.sql
replaced all the occurence of "ENGINE=InnoDB" with "ENGINE=MyIsam"
please help :( ,i tried several answers on a question similar to mine but the difference was that they uses WAMP server while i used XAMP , but they didn't help me
Use a browser like Chrome or Firefox and check the developer console (F12 in Chrome) for any errors coming from the AJAX request being made in background.
There is no need to hack installation files. It is important to understand what the error is and when does it occur.

Drupal 7 install failure OSX mavericks MAMP

I've been getting the dreaded WSOD on just the basic install of Drupal 7.26 using MAMP 2.2
I looked at Fatal error: Call to undefined function field_attach_load() in includes/entity.inc on line 321 during install
And also looked at Blank pages or "white screen of death" (WSOD)
I wasted several hours trying to find the problem. It seems to be related to an issue with PHP 5.5.3 which is the default on MAMP 2.2. I went into MAMP preferences, and changed the PHP tab to use PHP 5.2.17. I then edited /Applications/MAMP/bin/php/php5.2.17/conf/php.ini to add the settings for max_execution_time = 300 and memory_limit = 256M
I went back to MAMP and restarted the servers. Used a fresh copy of drupal-7.26 and the install finally worked (after adding a fresh new db and user in phpMyAdmin on http://'localhost':8888/MAMP/)
I still have no idea why PHP 5.5.3 fails miserably
I just had this issue with a new system and php 5.6. There is a lot of possible reasons for this problem according to drupal.org, see Link to Drupal.org
None of suggestion there worked for me.
My issue was really simple to solve. sessions did not work at all. so just check if you see something like "Failed to write session data" in your error logs.

xdebug on OS X partially working (e.g., prints stack trace in terminal but not browser).

I'm trying to get xdebug working on my Mac. I'm using OS 10.6 with the built-in versions of Apache (2.2.1) and PHP (5.3.8). I followed the "tailored installation instructions" on the xdebug website, which basically consisted of these steps:
Build xdebug (version 2.1.3) from source
Move xdebug.so to /usr/lib/php/extensions/no-debug-non-zts-20090626
Add to php.ini:
zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so
Restart the webserver.
From what I understand, that should be it. I know most people use xdebug with an IDE like PHPEclipse, but it doesn't sound like that's necessary just to get debugging output on the page. And a lot of old instructions involve installing MAMP, but it looks like that's no longer necessary.
Signs xdebug is working: When I run php -m and phpinfo() I get the expected information on xdebug. In scripts I'm able to call functions like xdebug_is_enabled() (returns 1) and xdebug_get_function_stack() (returns the stack).
Ways xdebug is not working: The main reason I installed xdebug was to get a stack trace when there's an error, and that's not happening. According to this documentation page, I should get a stack trace as long as display_errors is set to On in php.ini, (which it is). I've tried code that should evoke a warning (e.g., echo(hello)) as well as code that produces a fatal error (e.g., $x->awesomefunction() when $x isn't an object). Neither one produces any xdebug output, and the fatal error just causes the page to die silently. The test code given in the documentation I linked to also produces nothing.
UPDATE: It turns out that if I run a script with a fatal error from the terminal, I do get a stack trace from xdebug. However, it's still not showing up when I run the script from a browser
Also, regular error reporting is now broken: Previously, I'd get error output by including the commands:
ini_set("display_errors","1");
ERROR_REPORTING(E_ALL);
Now, putting those lines in my script doesn't produce any error reporting either. (in the browser. It does cause errors to be shown when I run the script from the terminal.)
So, what's wrong here? Did I leave something out of the xcode installation? Do I have a setting hanging around somewhere else on my system, suppressing errors? I've tried everything I can think of, but I'd be happy to test any ideas you have.
If it is working on console and not on browser, it's probably a xdebug configuration issue.
I'm not a Mac user, but on Ubuntu there are 2 different php.ini files, one for console and one for apache. If that's the case for Mac also, you can check if xdebug is enabled and properly set up in both php.ini files.
Also you can check the xdebug settings mentioned in the guide.
After several more hours of thrashing, I discovered that one of my test files actually was including another file that set display_errors to 0. The other test file was straight off of the xdebug site, but I think that at the time I was using it I'd introduced some other config error that prevented it from working properly. I'm truly embarrassed! Let this be today's object lesson in the importance of systematic, repeatable tests during debugging. On the bright side, xdebug is now working like a peach.
To summarize, the series of steps that worked was:
Build xdebug (version 2.1.3) from source
Move xdebug.so to /usr/lib/php/extensions/no-debug-non-zts-20090626
Add to php.ini: zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so
Add to php.ini: display_errors = On
Restart the webserver.

Categories