Custom Local Sever [Solved]

Hi, I need to launch the site in PhpStorm locally with this URL, http://localhost:80 server.php, note the space between 80 and server.php. That needs to be that way, how can I config phpStorm to run that when I run it from the IDE?


thanks for anyones help with this,

11 comments

Hi there,

I do not think it's possible as it's an invalid URL (the space instead of "/" -- between port and script name).

I mean -- you can try entering such URL (Run | Edit Configurations...) .. but none of them were accepting such URL when I've tried it.

The easiest thing would be to just use bookmark in your browser for that, I guess. And for debugging -- just use Zero-Config approach -- http://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm

0

Hi and thanks, I know it is invalid but this is the way the laravel framework works with some tools such as the codesleeve/asset-pipeline I can run it from CLI I guess or book mark that's fiine, I for whatever reson was not able to get the debugger working in either config type (zeo or normal) . Strange I used xdebug in netbeans fine. Overall the Jetbrains IDE's win out, so I guess I am stuck till I get the time to figure it out.

thanks for your help with this.

--jerry

0

I for whatever reson was not able to get the debugger working in either config type (zeo or normal)

Possibly path mappings.

How do you debug? What do you see?


Please collect logs:


What do you have in "Settings | PHP | Servers" ?
Any symbolic links?
As I understand everything is local.
What OS do you have there?
When you tried zero-config approach -- have you seen IDE popup asking to serup path mappings?

0

Hi and thanks, I tried both ways and no luck, I mean everything looks fine, I am running Gentoo Linux. xdebug is installed, it shows in the phpinfo, I am using built in web server to configure for this. Port 80 localhost. I attached 3 images from pertinent dialogs wihtin PhpStorm, When I would debug from IDE I would click to debug/run and nothing would happen, no browser would launch, nothing. When I attempted the zero approach, I would click to listen for connection put url query string in browser I would click and then nothing, the web page would show but I can never get it to sop on break point etc. I fyou have an idea I am happy for it, thanks again

--jerry



Attachment(s):
rundebug.png
interpreter.png
debugSettingspng.png
0
When I would debug from IDE I would click to debug/run and nothing would happen, no browser would launch, nothing.


On screenshot you have run/debug configuration of PHP built-in web server -- it should not run anything in browser -- AFAIK it only launches PHP's  web server in background.


1) What URL are you trying to debug exactly? If you launch it from IDE it should contain XDEBUG_START or something like that as part of the query string. If zero-config approach --- are you using bookmarklet or browser extension to set xdebug cookie (which tells IDE to initiate debug session)?

2) Screenshots -- you have missed another important here: "Settings | PHP | Servers"

3) Your xdebug settings (from php_info(); output)?

Maybe it is worth trying to configure xdebug to debug every single request (in case debug session is not getting initialised at all for whatever reason) -- xdebug.remote_autostart = 1

4) xdebug logs would definitely help here... At very least they would tell if xdebug tries to connect (and to where) or not.

P.S.
Webinar Recording: Debugging PHP with PhpStorm

0

If I click run the only thing that happens is that the php web server is started in the background, I launch my browser by hand, With Zero I tried bith methods and still nothing.

I attached the missing config you mentioned settings/php/servers

phpo.ini
[xdebug]
zend_extension = /usr/lib64/php5.5/lib/extensions/no-debug-non-zts-20121212/xdebug.so
; xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
; xdebug.profiler_enable=1
xdebug.profiler_output_dir=/tmp
xdebug.idekey=PHPSTORM


debug.ini

zend_extension=/usr/lib64/php5.5/lib/extensions/no-debug-non-zts-20121212/xdebug.so
xdebug.auto_trace="0"
xdebug.trace_output_dir="/tmp"
xdebug.trace_output_name="trace.%c"
xdebug.trace_format="0"
xdebug.trace_options="0"
xdebug.collect_includes="1"
xdebug.collect_params="0"
xdebug.collect_return="0"
xdebug.collect_vars="0"
xdebug.default_enable="1"
xdebug.extended_info="1"
xdebug.manual_url="http://www.php.net"
xdebug.max_nesting_level="100"
xdebug.show_exception_trace="0"
xdebug.show_local_vars="0"
xdebug.show_mem_delta="0"
xdebug.dump.COOKIE="NULL"
xdebug.dump.ENV="NULL"
xdebug.dump.FILES="NULL"
xdebug.dump.GET="NULL"
xdebug.dump.POST="NULL"
xdebug.dump.REQUEST="NULL"
xdebug.dump.SERVER="NULL"
xdebug.dump.SESSION="NULL"
xdebug.dump_globals="1"
xdebug.dump_once="1"
xdebug.dump_undefined="0"
xdebug.profiler_enable="1"
xdebug.profiler_output_dir="/tmp"
xdebug.profiler_output_name="cachegrind.out.%p"
xdebug.profiler_enable_trigger="0"
xdebug.profiler_append="0"
xdebug.profiler_aggregate="0"
xdebug.remote_enable="0"
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"
xdebug.remote_mode="req"
xdebug.remote_port="9000"
xdebug.remote_autostart="0"
xdebug.remote_log=""
xdebug.idekey="session_name"
xdebug.var_display_max_data="512"
xdebug.var_display_max_depth="2"
xdebug.var_display_max_children="128"


Here is part of my phpinfo output

http://pastebin.com/yuCNCmKB

It doesn't appear that I had a log file set and it doesn't have a default.

Hopefully this is enough.

thanks again



Attachment(s):
settingPhpServers.png
0

Well...

1) Your xdebug is DISABLED. As the result of it -- xdebug log will never be generated (plus, you have not provided path to it .. so it will never be generated anyway).

You have xdebug.remote_enable="0" while it should be 1 -- http://confluence.jetbrains.com/display/PhpStorm/Xdebug+Installation+Guide

2) "PHP | Servers"
You have "Use path mappings" option checked .. but no mappings provided (at very least for top level folders as shown on screenshot).

If everything is local and no symbolic links in use then just uncheck that option.

0

OK wonderful, where is it disabled? Then I will check out this other stuff and maybe I will get something done today.,

I appreciate all your help with this.

thanks

0

OK I set up the log and set the xdebug remote variable = 1, now I get this in the log over and over

Log opened at 2014-04-10 21:53:17
I: Connecting to configured address/port: localhost:9000.
E: Could not connect to client. :-(
Log closed at 2014-04-10 21:53:17


I still don't get a browser launch and I tried the query string in the URL and I also tried the chrome add-on and still nothing but the same message in the log.

0

OK got it going, I appreciate your help with this, I couldn't get run/debug but the I kinda like the zero option better anyway, thanks again

0

HI I'm back with respect to my original question and I found the answer and thought I would share it with you.

to start the php webserver like the following which is what I had to do.

php -S localhost:80 server.php

with the space in between localhost and server.php. This is what the "Use Router Script" checkbox and entry is for, by filling out the run config as in the attched picture, this will accomplish this goal

thanks

--jerry



Attachment(s):
server.png
0

Please sign in to leave a comment.