Debugging PHP with Aptana Studio 3.3 and MAMP - php

I am trying to set up the PHP debugger in Aptana Studio 3.3 to work with MAMP. I have a local project folder which is separate from the MAMP/htdocs folder; I 'deploy' to MAMP by copying the files from my local project folder to htdocs.
I've set up Aptana Studio->Editors->PHP->PHP Interpreters by adding a new interpreter of XDebug debugger type, with an executable path and PHP ini file pointing to the appropriate location and file for my MAMP install (/Applications/MAMP/bin/php5.4.4[/bin/php || /conf/php.ini]). The PHP debugger is set to XDebug. Aptana seemed to like that OK.
But, when I open a PHP file in my htdocs folder and try to set a breakpoint, I get the error "The file you are trying to place a breakpoint on is an external (non-workspace) file. Breakpoints are supported for PHP files that are located inside projects."
And, if I try to set a breakpoint and start the debugger in the same PHP file (but in my local project folder/workspace rather than htdocs), nothing happens. This makes sense as the file isn't under htdocs so MAMP doesn't know about it.
This would imply that my local project folder and my MAMP/htdocs project folder have to be one and the same in order to debug. I'd rather keep my project files separate from htdocs.
I would much appreciate your advice on 1) how to set up the PHP debugger in MAMP to get it to work at all (what am I doing wrong?), and 2) is it possible to set up the debugger to work so I can have my local project folder separate from the MAMP/htdocs folder?
There are other StackOverflow answers but they all describe how to set things up for earlier versions of Aptana Studio which didn't include the PHP debugger.
Thanks.

Related

Correct way to use eclipse and xdebug

I downloaded the pdt plugin for eclipse for php development. I have mamp installed , with the web port set at 80. The name of my project is PHPTest.
I have one file in it ,called helloworld.php.
Hello world just echoes A text.
This project is located at
/Users/MYUSERNAME/EclipseProjects
When I run the project by right clicking on it, It shows this error in my browser :
Not Found
The requested URL /PHPTest/helloworld.php was not found on this
server.
So, why does this happen ? Is there some setting that I am missing?
or is the only way to get this running is to change the project's directory to the public html folder of mamp ?
This isn't related to xdebug support. Your HTTP server know nothing about your projects. you can fix this in three way:
Manually copy/paste project to your MAMP document root dir (default is /Applications/MAMP/httpdocs)
Change MAMP document root dir to workspace: /Users/MYUSERNAME/EclipseProjects (easies way)
Move your workspace to document root dir (/Applications/MAMP/httpdocs)

PHP in Eclipse, how to run PHP on some server?

On Eclipse i installed the PHP Development Tools and everything is cool, except i can't configure it to run on my local Apache...
I saw something like placing all my project files in some htdocs directory of Apache directory... but its kinda absurd...
I already tried:
http://www.eclipse.org/pdt/help/html/running_php_web_pages.htm
and
http://www.eclipse.org/pdt/help/html/php_servers.htm#Adding_servers
Which, as i understood, is linking calls from localhost/[project-name] (which directory is placed as htdocs) to my original repository x:/y/[project-name], but it doesn't work...
You might need to setup the workspace for your eclipse. The directory you set as workspace works as the document root directory and you don't need to place everything in htdocs. Hope this helps.

How tell PHPStorm debugger, that my project has document root other than project root

I'am trying to set up PHPStorm with xdebug. Everyting launches fine, but breakpoints just do not work and have "x" symbol on them.
I'm using openserver with PHP 5.4 and editing files directly on the local web server, so no file mapping is necessary.
I think, that my problem is that web server root is located below the project root directory (for security reasons) and PHPStorm does not that.
Project root: C:\OpenServer\domains\mysite
Web server root (configured in nginx): C:\OpenServer\domains\mysite\httpdocs
How do I tell PHPStorm, that the index.php that webserver runs is actually C:\OpenServer\domains\mysite\httpdocs\index.php, but not C:\OpenServer\domains\mysite\index.php?
You have to use path mapping.
You can find it in debug server configuration
Check out official docs and vids:
Help page
PHP Debugging webinar recording
JIT debugging
Smart step into
Simultaneous debug sessions
In my case, I tried these steps:
step 1: uncheck these two options at xdebug section
step 2: copy & paste the directory of your project at /xampp/htdocs/{your-project}

how to run php script in eclipse

I installed Eclipse PDT-all-in-one-win32-2.0.0GA and WampServer 2.0.
I try to run as PHP Script in eclipse but I have this error:
"The current debugger does not have any defined PHP executable."
How do I create this .exe ??
Ok But I do not have php.exe. I only create Test.php in my project.
In order to run **.php* files, you will need PHP installed, and because you already have installed WAMP, you should be fine.
"The current debugger does not have any defined PHP executable."
If you have installed WAMP as you said, try to look for php.exe on your local hard drive and then set path in Eclipse that leads to it (eg. c:\wamp\bin\php\php5.2.9-2\php.exe). Go to Window\Preferences\PHP\PHP Executables and add this path to the list.
You do not need to create this .exe
In Eclipse you need to configure the debugger settings. The debugger needs to know where the php.exe file lives.
Edit: php.exe ships with the standard PHP install on windows. When you download PHP from www.php.net you will find the php.exe file somewhere in the directory you installed PHP in.
Hope this helps :-)

Netbeans not copying source files to web folder

I'm using Netbeans to develop an HTML/PHP site and I have the Run Configuration set as follows:
Project URL: http://localhost/JEB
Project Folder: C:\Documents and Settings\John\My Documents\NetBeansProjects\JEB
Source Folder: C:\Documents and Settings\John\My Documents\NetBeansProjects\JEB
Web Root:
The "Copy files from Sources Folder to another location" option is checked and the Copy to Folder location is: C:\xampp\htdocs\JEB.
The problem is, when I edit files in the Project Folder, and then click Run, I'm expecting them to copy to the web location (C:\xampp\htdocs\JEB) and then run in the browser. But that's not happening. The files are not getting copied over so I'm seeing the old versions of the files that were previously in the C:\xampp\htdocs\JEB folder. (I had this working once before, I thought.)
Am I misunderstanding how this works? I thought you were supposed to edit the files in the Source folder, and they would automatically be copied to my web server folder when I ran the project locally. I've checked the NetBeans forums and found one other person with this problem, but no working solution. I was having this problem with Netbeans 6.5.1 so I upgraded to 6.7.1 and still no luck.
Thanks.
I had this problem too and it seemed to be a bug in NetBeans. I was using Ubuntu Linux 9.04 with NetBeans 6.5 and 6.7.1.
When it happened to me, I would delete all of the files in the destination location and then run the project again. When NetBeans sees that there are no files there, it copied the latest version over. From then on it usually worked correctly (i.e. automatically copying files from the source to destination folder every time I ran the project). Sometimes I also had to restart NetBeans for this to work correctly.
Not a solution, but work around.
Create a XAMPP Alias to the directory where your files are located, see: Make XAMPP/Apache serve file outside of htdocs

Categories