Validating debugger configuration : Specified URL is not reachable (404)

Hello,

My setup :

Host : Windows 10
VM : Debian 9 (stretch) running Nginx
PhpStorm working directory is a mounted drive (samba) named V: pointing to /var/www in my VM
I configured a remote interpreter via SSH Credentials, and PHP executable set as /usr/bin/php

 

Validation tool :

Path to create script : V:\myproject\pub (because this is a Magento 2 project, web root is pub)
Url to validation script : https://local.myproject.fr (checked in browser, displays my homepage)

When trying to run the debug validation, I get this error : "Specified URL is not reachable, caused by: 'Request failed with status code 404'"

I tried other variations with php interpreter (deployment configuration using + SFTP deployment server, SSH Credentials..)
I also tried different variations of deployment servers (mounted folder, SFTP) used directly by validation tool via "Remote Web Server"

I think I have read too much tutorials and forum posts, and now I'm totally confused... I cannot figure out what is preventing PhpStorm from reaching the specified url...

Can somebody help me ?

 

Thanks by advance !

14 comments
Comment actions Permalink

Please use this article to troubleshoot this: https://www.jetbrains.com/help/phpstorm/validating-the-configuration-of-the-debugging-engine.html & post screenshots of your results if that doesn't help

 

0
Comment actions Permalink

Hello Dmitry, and thank you for taking the time.

Well, I was already using this article to help me in this process and it didn't help me. I think I'm just missing the real issue here and I need help to spot it.

Here are the screenshots :

 

Thank you by advance !

0
Comment actions Permalink

Anything missing for someone to help me ? I'm still stuck with this issue :(

0
Comment actions Permalink

Sorry for leaving you without the response.

I was wondering if it is possible to try a short test.

The idea is simple -- place any test html/php file in "Folder" of your deployment server and try to open it via URL like "https://local.myproject.fr/file.html". 

Another option is to create a file in the root of the project and try deploying it to the Web Server with "Deployment > Upload" option.

Also, a short remark -- did you try using "http" instead of "https"?

0
Comment actions Permalink

Hi,

I 've got the same problem. Is there any solution?

0
Comment actions Permalink

Hello,

Did you try recommendations from this thread already?

0
Comment actions Permalink

Honestly the worst documentation ever. For every project getting stuck in debug configuration, and have to spend hours doing it

0
Comment actions Permalink

Same problem, guides are not helpful.

I need to setup XDebug on a ubuntu php 7.2 fpm pool on a remote server that I SSH into.
XDebug shows up in phpinfo, and I can view the website just fine on the URL configured.

Can see the file that PHPStorm uploads the file when I click the Validate button by using.

inotifywait -m .

_intellij_phpdebug_validator.php

I copied the contents and saved with the same file path on the remote by using tail -f to get them, I can see it in web browser view:source just fine yet no luck in PHPStorm.
Specified URL is not reachable, caused by: 'Request failed with status code 404'


Found the solution however, Magento 2 with nginx my root is pub.

The URL it checks on server is pub/_intellij_phpdebug_validator.php but thats already the root so really it needs to not goto pub/ e.g.

https://mysite/_intellij_phpdebug_validator.php

Added a Nginx rewrite rule like this to the nginx.conf created using the magento 2 config as a template.

 

 

location ~ ^/pub/_intellij_phpdebug_validator.php {
rewrite ^ /_intellij_phpdebug_validator.php last;
}

# PHP entry point for main application
location ~ (index|get|static|report|404|503|_intellij_phpdebug_validator)\.php$ {

0
Comment actions Permalink

The URL it checks on server is pub/_intellij_phpdebug_validator.php

It's not really clear why PhpStorm would append pub to the URL unless you specified it yourself in the Web server URL field of the deployment configuration.

0
Comment actions Permalink

Yes pub is the web root of Magento 2 with Nginx but the folder above pub is the "project root" that phpstorm uses.

/var/www/somesite/ << Files in here.
/var/www/somesite/app
/var/www/somesite/app/code
/var/www/somesite/app/design
/var/www/somesite/pub/ << Website Root directory

So I wanted _intelij_phpdebug_validator.php to go in the pub directory, but phpstorm appends /pub to the url because it is seemingly not aware that the website root is different to the mapped project root. Maybe there is a config for that too I don't know this way worked for me.

1
Comment actions Permalink

I am having the same issue as Liam is having.

My project root is at /var/www/ea/

Source code is at   /var/www/ea/src

Webroot is at /var/www/ea/webroot

 

So when I put my path to create validation script as D:\Projects\EA\github\eal\webroot\   - it should map to my root site at http://ea.example.com

However, every time i do it I get errors that it cannot find the file/access it. What on earth is the deal here? 

0
Comment actions Permalink

@Liam Karl Mitchell, @Barry Chapman

Please show your deployment settings (mappings in particular).

Based on your info so far you may not have the necessary mapping in place (usually an additional entry for such setup when website public root is a subfolder)

0
Comment actions Permalink

Was having similar issues as those above.  I'm using AWS EC2 Amazon Linux AMI.

If you have your the root of your website set as something similar to /public, and have other app folders either above or as a sibling to that folder, then the Validate Debug Configuration on Web Server installs the validation script at:

 

/var/www/<root website folder>/public/_intellij_phpdebug_validator.php

 

and then tries to validate using http://<website>.com/public/_intellij_phpdebug_validator.php instead of the required http://<website>.com/_intellij_phpdebug_validator.php

 

Similar to another solution above, I solved this issue by adding the following Redirect to the .htaccess file in /var/www/<root website folder>/public folder:

 

Redirect /public/_intellij_phpdebug_validator.php /_intellij_phpdebug_validator.php

 

Hope this helps someone save a few minutes of their day.

0
Comment actions Permalink

Or, you can just set appropriate mappings for the deployment configuration.

1

Please sign in to leave a comment.