13 comments
Comment actions Permalink

I'm using Phpstorm and would like to create a project for a subdomain that has its file structure at the same level as (not under) public_html.

I see an issue similar to this dating back to 2012. Has there been any progress? The URL would be subdomain.mysite.com and the server files would be something like home/subdomain_name...

If this is currently possible, is it clearly documented anywhere?

Thanks!

0
Comment actions Permalink

Hello,

Not sure if I got you right - do you want to create a separate project that would download and upload the files from a specific subdomain folder?

From PhpStorm's point of view it does not matter if the project is located in the public_html or not - it is all up to the web server side with which we do not interfere.

If not then more details about the scenario you want to implement are necessary.

0
Comment actions Permalink

Sorry about not coming back to this sooner.

I am particularly interested in coming up with a mapping that will work for xdebug in Phpstorm.

Here is what I have:

test.mysite.com (url)

home/myname/testsite (on server)

blablabla/Phpstorm projects/mysitetest (locally, in Windows 10)

 

Most recently, I have in Phpstorm:

test.mysite.com (SFTP host)

home/myname (root path)

http://test.mysite.com (webserver root URL)

and under mappings:

blablabla\Phpstorm projects\mysitetest (local path)

testsite (deployment path)

/ (Web path)

 

When the debugger gets triggered, I get:

cannot find a copy of the local file on server home/myname/testsite/index.php

and

local path is blablabla\Phpstorm projects\mysitetest\home\myname\testsite\index.php

 

So, clearly I am doing something (or several things) wrong. I would appreciate any guidance on how I should set this up so that everything (URL and xdebug) work properly. Many thanks in advance.

0
Comment actions Permalink

So, how do I get Phpstorm not to add the "home\myname\testsite\" after what should be the correct 
"projects\msysitetest"? Where is that coming from, as I don't see it in my mapping?

Is this a bug or is there a way to configure this properly?

Thank you.

0
Comment actions Permalink

Hi there,

It's a bit unclear what you have got there ... but so far it sounds like you may have "Detect path mappings from deployment configurations" option enabled and have not provided actual path mappings (PHP | Servers) .. and all this somehow does not work properly.

If that's so -- could you please disable that option (HINT: use search box in Settings/Preferences screen no narrow possible options) and provide proper mappings in "Languages & Frameworks |  PHP | Servers".

If still nothing -- provide screenshots with all related settings.

P.S. I assume that actual deployment works fine?

0
Comment actions Permalink

So, the "detect path settings..." option was selected and I have deselected it, and have even restarted Phpstorm.

However, I see no difference.

I am attaching screenshots:

It appears to me that the remote server seems to match the local server files. However, I still get the local path error. Where is it getting decided to add the remote path to the correct local path? Is this enough information to figure out the problem and solution?

Thanks.

0
Comment actions Permalink

From your first screenshot ... you have put only "/" -- but it meant to be what that column name says -- absolute path to that folder but on remote server.

So .. please put "/home/jsasse5/surveytest/" there

If still nothing (which I doubt as it should not be the case) -- please post updated 2nd screenshot.

0
Comment actions Permalink

Ok, so I put in the correct absolute folder. Thanks for catching that!

It gave me an error about not finding index.php and, unfortunately, I didn't get a screen capture of that.

I also mapped the local index.php to the remote index.php (even though each one seemed to be exactly where it should be) and didn't get an error.

I then removed the mapping for index.php and I no longer get any error messages.

However, xdebug is only stopping when I select "Break at first line in PHP scripts". It won't even stop for a breakpoint in index.php if "Break at first line" is off.

What next, please?

0
Comment actions Permalink

Also, I just tested adding a file locally and uploading it to the server, and that works, putting the test file on the server in the proper subfolder, so doesn't that suggest that the mapping is at least somewhat correct?

0
Comment actions Permalink

Did you put actually breakpoints anywhere?

Ideally you should put them on simple lines (and not multi-liners (e.g. multi-line array definition) where correct line to put breakpoint will be somewhere in the middle).

You can also always place xdebug_break(); in your code (programmatic breakpoint).

If you're still having issues -- restart IDE .. or even whole PC (just in case it might got stuck somewhere from your past attempts). Ensure that you have no other debug sessions running.

If anything -- collect xdebug log: https://xdebug.org/docs/all_settings#remote_log

 

P.S. In case if you have not seen it yet: https://confluence.jetbrains.com/display/PhpStorm/Debugging+with+PhpStorm

0
Comment actions Permalink

>Also, I just tested adding a file locally and uploading it to the server, and that works, putting the test file on the server in the proper subfolder, so doesn't that suggest that the mapping is at least somewhat correct?

As I have said in my first message: "P.S. I assume that actual deployment works fine?". If deployment would not work then you would be complaining & looking into this issue first rather than looking at debug.

So far it could be that this "Detect path mappings from deployment configurations" option does not work correctly... at very least for your scenario.

0
Comment actions Permalink

>However, xdebug is only stopping when I select "Break at first line in PHP scripts". It won't even stop for a breakpoint in index.php if "Break at first line" is off.

BTW -- does it show you the message in popup box? Check the message log (in IDE .. or in idea.log file). Message would be something like "Debugging session ended without stopping" -- something among these lines.

Please also ensure that breakpoint is set in the right file that actually gets executed (sometimes you may use similarly named file but in wrong folder; or some cached file gets executed instead of your latest version; you may also want to see if disabling or re-configuring OPCache will help here (it may have been configured in such way that is not good for debugging/dev work and more suitable for production use))

0
Comment actions Permalink

I think that restarting my PC may have done the trick. If not, I'll respond back.

Otherwise, thank you for staying with this and helping me!

0

Please sign in to leave a comment.