how can I get xdebug to run in Windows - php

I apologize if I am not following protocol with this question; I realize it has been asked. However, I have yet to see an answer (that works)
I am trying to get xdebug working on a Windows 7 box.
Whatever build I try (and I have tried more 5 to this point), I get this message when I run php -m : Failed loading C:\PHP5\ext\php_xdebug-2.2.2-[compile + build].dll
I have used the "wizard" (it doesn't provide much information) and it is the only module that doesn't work.

Make XDebug works can be a little trick. But, after move through all challenges, you will see the benefits of quickly find bugs and quickly fix them.
First of all, you need to find out which is the version for your environment. It is tight related with PHP version you are running and XDebug page is the place to go to figure it out.
The XDebug wizard helps you to get the Xdebug module compiled to fit your environment.
If you copy the output of the following command:
php -i
inside the text box and hit the button "Analyse my phpinfo() output" as showed below:
You will see a report about the XDebug version you need. Most of times, the link to download it is available as showed below. If the link do not show, your version should have no compatibility with Xdebug
After follow the instruction gave by wizard page, the output of the command:
php -m
should be something like the image below:
Xdebug load successfully on [Zend Modules] group. Of course, it is not enough to make it work. But will be enough to you move forward. You told us, you used the wizard. If the steps above was the same you follow tell us what is the wizard output as a comment.

Related

php-cgi not found error constantly

I am trying to open a browser locally to debug what I am writing in PhpStorm. However regardless of everything I have installed PhpStorm constantly complains with "php-cgi not found" issue.
I have installed homebrew with PHP 5.6
I have installed fastcgi and I've read up pretty much everything there is for this error. However I am still getting this "php-cgi not found" issue
I have installed Apache using this guide http://jason.pureconcepts.net/2015/10/install-apache-php-mysql-mac-os-x-el-capitan/
When I access http://localhost/phpinfo.php I can see the php info
Here's what just worked for me - as I was having the very same issue. Note that I was looking to install PHP 5.6.x here, so this answer conforms to that, and as of this writing, 5.6.36 was the most current version of 5.6 that brew had available. Obviously we're also dealing with MAC here.
Open Terminal
If you have brew installed, type brew install php56
Once completed, your terminal window will contain a plethora of information. One thing to look for is the path to PHP that was just installed. Look for If you need to have this software first in your PATH run:. Just below that, you'll see two paths listed. One ends in bin, the other in sbin. You want the one that ends in bin.
Open PHPStorm's PHP CLI Configuration (Preferences -> Languages & Frameworks -> PHP)
At the end of the CLI Interpreter box, click the ... to open up the options.
Click the + on the top-left to add a new interpreter.
I typed "PHP 5.6" in the "Name" field... type whatever you'd like to appear.
In the PHP executable field, enter the following /usr/local/Cellar/php#5.6/5.6.36_1/bin/php-cgi (again, this is based on the path you will find in your terminal window - described in the third step above)
Once you enter that and leave the field, PHP Storm should detect the build and where the php.ini file is located, automatically.
Click "Ok"
You're done. This worked for me on three different installations.
Hope this helps someone.

Getting started with solr

I've struggling a lot trying to get solr working. I've read the official docs and tutorials, tried them out but still couldn't figure out how to get started. I took to randomly test out blogs which resulted in crashing of my ubuntu OS.
So, I'm framing a question here, outlining every possible doubt of mine and everything I've tried out.
I downloaded the apache solr 4.3.0 from here: http://lucene.apache.org/solr/
Next, I unzip the file [path: /home/ps/solr] and inside there is an example directory containing the schema.xml, solrconfig.xml and other important files.
Next, I choose the official solr php client and installed it. [Link: http://docs.php.net/manual/en/book.solr.php]. It requires a PECL extension which I forked from here [https://github.com/lukaszkujawa/php-pecl-solr] as there are some issues with running it with solr4.x. The path of php-pecl-solr is home/ps/php-pecl-solr. I followed this blog (http://systemsarchitect.net/integrate-php-application-with-solr-search-engine/) to install the PECL extension.
After all this, I tried writing down a test script (http://dpaste.com/1173282/) as in the blog, and running it: it displayed nothing. The page wasn't opening. The file's path was var/www/testsolr/index.php
My doubts:
Why isn't the page opening? What am I doing wrong here?
How to connect the example directory of solr with this php-pecl-solr extension?
I'm just a beginner with these things and would be happy if someone helps me out.
Solr comes with logging code, but it's not enabled by default.
From the example directory, rather than "java -jar start.jar", add a system property on the command line that imports the logging.properties file. If you launch start.jar from the example directory, use:
java -Djava.util.logging.config.file=etc/logging.properties -jar start.jar
your log will be in example/logs/solr.log.
I recommend that you not use PHP until you've got solr properly configured and running reliably, after you've been able to import your data and you can do queries from your browser the return the expected results.
I'm new to solr too. I've been beating my head against it for two weeks, but I'm starting to have some success.
Your log is likely to contain lots of Java exception stack traces. These are almost always the result of errors in your configuration files, but the log is very unhelpful in that it doesn't tell you what line of which file has the error! Thus I've had to beg Google for insight, which is sometimes found here at Stackoverflow.
Make sure you have your JDBC connector installed. It will be a free download for whichever database server your using, but is not bundled with solr.
First you need to make sure you have Solr running on your server. The simplest way to this is to run java -jar start.jar from the example directory under /home/ps/solr. This will startup Solr using Jetty at the url of http://127.0.0.1:8983/solr.
You will need to modify your test.php file and put the full url http://127.0.0.1:8983/solr for your hostname item in your $options array.

Debugging with eclipse and xdebug won't go past the first line

Yes I have tried searching on StackOverflow and Google for my problem. If you read the entire question you will see that I include a lot of links to previous answers that I found using both.
I have been trying to get XDebug working with Version: Juno Service Release 2 of Eclipse for about the past hour and a half and I'm running into a log of issues. I've already solved most of my problems by using stack overflow and Google.
I followed the steps here first to install the debugger.
I made sure that I added the debugger as a zend_extension as mentioned in this post.
Here are the relevant lines from my php.ini file
zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.collect_params=4
xdebug.var_display_max_depth=999
xdebug.dump.POST=*
xdebug.dump.GET=*
xdebug.show_local_vars=1
I made sure that I edited the php.ini file for the 5.3 version of php that comes with MAMP. At this point the debugger would start even though XDebug does show up when I run php -v.
Since I was still having issues I checked the logs just like someone did here. I noticed this error in the logs:
PHP Fatal error: Class 'Model' not found in ...
After checking the documentation for the latest version of CodeIgniter I noticed that all Models have to extend CI_Model and not Model.
I fixed that and the error is no longer being printed to the logs, but now things just don't work. The debugger won't go past the first line when I try to debug a file.
I'm trying to debug my php application as a PHP CLI Application. When I try to debug the application as a PHP Web Application I get an error message that says:
No tab group defined for launch configuration type org.eclipse.php.debug.core.launching.webPageLaunch
After Googling the problem, I came across this post that suggested that you might not be able to do what I'm trying to do. Since the question was first asked in 2009, I decided to try the second suggestion and check for any updates.
After updating all of my Eclipse plugins I was still having the same problem. After searching on SO some more, I saw that this guy just gave up and tried with NetBeans and got everything to work.
Should I just consider the past 1.5 - 2 hours as a sunk cost and just move on to a different IDE?
I also had issues getting XDebug to work with Eclipse and XAMPP. In the end I decided to go with Netbeans and it was a lot smoother getting it setup. I am still using Netbeans to date for all of my PHP development.
Possibility your Php CLI is picking wrong php.ini file ?
Please go to terminal and check which ini file is loaded by :
php --ini
and make sure its desired one.
jerrod.taylor,
I had a lot of issues when starting use PHP,Xdebug and Eclipse. I considered change IDE myself but I liked the challenge and found a lot of help online. I will try to provide you with some tips will help you.
First of all this is the parameters I have in my php.ini:
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9060
xdebug.remote_handler="dbgp"
xdebug.remote_autostart=On
I am using local machine as remote host. Adapt for your world. This configuration works for me with CLI and Web debugging. I am really not sure if some of them is specific for different kinds of debug. So, lets start with all of them.
Now, make sure xdebug is been supported. Run the following command and see if exist something not good.
php -i|grep xdebug
NOw, lets go to Eclipse. In Eclipse preferences add the correspondent PHP executable and make sure the debuger type is Xdebug. This step can be done navigating through Preferences->PHP->PHP Executables. If you add an item, the form you ask you for the following information:
Name : Choose one
Executable Path : the_path_to_php_exe
PHP Ini file : you can leave it blank
SAPI type : CLI
PHP debugger : Xdebug
This step is important. It is how we will tell eclipse the executable to use.
Now, lets add a debug configuration. I have one project called upload in my workspace and exist a file index.php on this project. To create a debug configuration click in new when "PHP CLI Application" is selected. It will be add a new configuration form for you. For my Debug configuration I have the following information:
Tab PHP Script
Run Time PHP
Alternat PHP: (Select the PHP executable you have created above)
PHP File : /upload/index.php
Break Point : Break at first line is selected
This steps should be enough to you solve your issues. Let us know how it was.

Using inclued php pecl extension

I'm currently trying to level up on my PHP debugging skills and as part of that I'm trying to learn several new tools. One of them is inclued.
The extension seemingly works fine (no startup error, shows up in phpinfo, generates dump files), but it always reports number of includes as 0, so something is clearly not working right.
At first I suspected this was related to my heavy use of auto_include, but after doing some tests which do not, I doubt that is related.
Class graphs are generated OK, but include maps simply don't exist. Am I simply Doing It Wrong, or is the extension broken? I just don't know and even after some heavy duty googling cannot find anything useful.
I installed inclued using the "phpize method". My PHP version is 5.3.2 running on Mac OSX 10.6.5. I also have XDebug and memtrack installed.
After doing a test run with valgrind watching Apache I noticed xdebug was operating below inclued. On a blind test I tried disabling XDebug and lo and behold: inclued works as expected.
So to answer my own question:
Don't use XDebug in conjunction with inclued if you want to have include graphs. Class graphing works fine with XDebug running.

php, xampp and debug - can't get to work

I know this question has been asked before and I've looked through the responses but no matter what I do, I can't create an environment to step through my php programs.
I've downloaded the XAMPP stack, and Eclipse and enabled xdebug but nothing.
PHPinfo reports: Debug Build, No.
Does that mean that I'll never get an XAMPP installation to debug. If so is there another Windows, Apache, PHP, MySQL stack recommended?
I downloaded the Komodo IDE 21 day free trial and their wizard can't start debug either.
help
No, the Debug Build phpinfo() refers to is a compile-time switch/define that affects the way php itself is compiled. The debug build is less optimized, contains some more test code and the symbol files, used when stepping through the php C code with a debugger, are more accurate (mostly due to the less optimized code).
It does not affect the ability to add a script debugger module like xdebug. But you need a version of the module .dll/.so that is compatible with your version of php. The API version, Thread-safety "enabled/disabled" and "debug yes/no" information must match. (on second thought I'm not even sure if debug yes/no must match).
Does the xdebug section appear in the output of phpinfo()? If not make sure you've edited the right php.ini. In recent versions of xampp that should be <xampp dir>/php/php.ini regardless of whether you use php-cli or the apache module. But it used to be <xampp dir>/php/php.ini for the cli version but <xampp dir>/apache/bin/php.ini for the apache module of php.
Also check the error.log in <xampp dir>/apache/logs for error messages that might be related. Those should begin with "PHP Startup: ....error message..."
try using wamp if your using windows. It works great for me

Categories