Got a few problems while evaluating phpstorm

I'm trying out the program the first time and I get errors and warnings that should not be there. because the page loads up just fine. I have screenshots. categories.php

Undefined variable '$connection'
Path 'inc/header.php' not found
Path 'inc/nav.php' not found
Path 'inc/footer.php' not found

are the ones I'm talking about 

db.php screenshot the warrings are valid code.

header.php is valid too 

Refactoring seems to be not working I provided a screenshot 

and is there a way to fix a code typo automatically or to see how it should be spelled?

here is my project

Upload id: 2021_01_30_CTt1LuYmN3hQkqd7 (file: CMS.zip)

27 comments
Comment actions Permalink

Thanks for the example.

1) Path 'inc/header.php' not found. - That's a known issue, caused by the fact that there are multiple directories with the same name: https://youtrack.jetbrains.com/issue/WI-2957

Try specifying includes using include __DIR__ . "path"; syntax:

 

2) Undefined constant 'DB_HOST' - that's because constants aren't defined anywhere in a project using traditional syntax (the one that static analyzer can understand).

You can suppress the warnings using the /** @noinspection PhpUndefinedConstantInspection */ annotation above the assignment.

 

3) header.php is valid too.

Shouldn't you use 

    <!-- Bootstrap Core CSS -->
    <link href="../css/bootstrap.min.css" rel="stylesheet">

instead of 

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

? There's no css folder where header.php resides.

For the links warning you can use Alt+Enter menu to download links definitions:

 

4) Refactoring seems to be not working  - That's because of p.1.

If you have include __DIR__ . "inc/header.php" and then invoke Refactor > Rename on a header.php in a project tool window with "search for references" enabled - it would also update the references in a code:

0
Comment actions Permalink

For the links warning you can use Alt+Enter menu to download links definitions:

I tried that but got a 500 code

0
Comment actions Permalink

Could you please attach a screenshot of that error?

0
Comment actions Permalink

 That's a known issue, caused by the fact that there are multiple directories with the same name:

https://youtrack.jetbrains.com/issue/WI-2957:

that link does not work

0
Comment actions Permalink

here's the error

0
Comment actions Permalink

The link posted by me is fixed now. Here it is again: https://youtrack.jetbrains.com/issue/WI-2957.

As for 500 error: are you behind a proxy? Is there anything unusual in your network connection?

0
Comment actions Permalink

not behind a proxy and my internet works. 

0
Comment actions Permalink

and this bug is 10 years old will it ever be fixed?

0
Comment actions Permalink

and I can't get these errors to  go away

0
Comment actions Permalink

Is there a way to suppress errors or just 1 error without turning the error off in settings?  

0
Comment actions Permalink

Sorry, can't provide any ETA on this bug. Unfortunately it has just 8 votes in 10 years and the "include"-style coding becomes less & less utilized nowadays - I wouldn't hold my breath waiting for it.

 

and I can't get these errors to go away

Try adding <!--suppress HtmlUnknownTarget --> below the <!DOCTYPE html> in the beginning of the file.

> not behind a proxy and my internet works. 

No more ideas, sadly. We would need to look into logs. You can send them over to us via Help | Contact Support.

0
Comment actions Permalink

is there a way to suppress 1 error without turning the error off in settings?  

 

and how to upload logs

0
Comment actions Permalink

1) Yes: place the cursor on an error, then hit Alt+Enter, then select a warning > right arrow > suppress for ...: https://i.gyazo.com/b126bf35e58028913a814213a7d80e5f.mp4

2) you can either attach them directly to a support ticket or upload via https://uploads.jetbrains.com/

 

0
Comment actions Permalink

1) Yes: place the cursor on an error, then hit Alt+Enter, then select a warning > right arrow > suppress for ...: https://i.gyazo.com/b126bf35e58028913a814213a7d80e5f.mp4

that didn't work for me

Upload id: 2021_02_05_B4nQ95ae6Wtwsxo9 (file: 2021-02-05 13-45-02.mp4)

where do I find the logs

0
Comment actions Permalink

Thanks for the video. Some errors/warnings are indeed can not be suppressed, like the one on the video: https://youtrack.jetbrains.com/issue/WEB-29374, https://youtrack.jetbrains.com/issue/WEB-31857.

You can find logs using Help > Collect Logs and Diagnostic Data action, or Help > Show log in ... 

0
Comment actions Permalink

will this issue not be fixed too?  Do you ever fix small bugs? it's very annoying to not be able to at least suppress the bug! IMO it's very lazy of PHP storm

0
Comment actions Permalink

Probably... But worth noting: there are no votes or comments for both issues for the past couple of years. Secondly: the inspection is right here. 

And for what it's worth our team fixed 158 issues/features starting the January 2021.

0
Comment actions Permalink

the inspection is right here

I don't know what you mean.

 

And I can't get live edit to work?

I tried just HTML file 

and I started a debug session

Upload id: 2021_02_09_TJZ2Cj9EXTn5Sy5Z (file: 2021-02-09 15-10-57.mp4)

I have to still refresh the page to see changes.

Upload id: 2021_02_09_7yCop6TRrzikkdD2 (file: 2021-02-09 15-28-47.mp4)

live edit not working is a deal-breaker for me I can deal with the small things but this should work just like other IDEs I use

my logs for both problems

Upload id: 2021_02_09_UWRPW2qqRDQmgQSa (file: phpstorm-logs-20210209-163236.zip)

0
Comment actions Permalink

You are editing code in external js file, as far as I can see; unlike changes in embedded JavaScript, changes in 'external' (linked) JavaScript code don't cause immediate page reloading: new code is loaded to the browser instantly, but the results of the change will be visible only when you do something to trigger this new code. For example if you change the onClick handler and write new text in alert(), you will see the new text after the click without reloading the page. Same for functions triggered by timer, for example. But if the JS code is executed only on page load (and not on certain event), you have to manually reload the page to see the results - Live Edit doesn't force new code execution, it changes the code and not application state.

0
Comment actions Permalink

when I make changes in the HTML file does not update too and I talking about HTML not JS? if I install live-server installed on the node.js in PHP Storm it works with external js files? are you telling me I have to have the JS embedded for it to work? that makes no sense when live-server can do it?

0
Comment actions Permalink

In your screencast, you are changing JavaScript code, not HTML.

If you have problems updating HTML code, please record a new video

>if I install live-server installed on the node.js in PHP Storm it works with external js files?

please could you clarify what live-server you refer to?

0
Comment actions Permalink

live-server is a plugin or package that runs in PHP storm terminal on node.js and it updates Js files, CSS Files, and HTML files after a save and updates the page.   how can Live edit not do the same? I find that hard to believe.

Like Dreamweaver does it, VS code does it, Brackets does it, etc it's the standard nowadays?

here's the HTML video

Upload id: 2021_02_12_BVz2k4jaDiDRe1rd (files: 2021-02-12 10-58-00.mp4, 2021-02-12 11-03-50.mp4)

 

 

 

 

0
Comment actions Permalink

In your video (2021-02-12 10-58-00.mp4) the page that you are refreshing is not the one that is being debugged, it's a page opened on a built-in web server for previewing. And Live Edit is only active during a debug session. The one the debugger is attached to is served by your node.js server and has a different URL

 

>how can Live edit not do the same? I find that hard to believe.

Unlike live server, with Live Edit page updating is not done on the server end (so Live edit is not server-specific, it works regardless of the web server the application is hosted on); and the page is not reloaded, the code is hotswapped instead

0
Comment actions Permalink

I got the HTML, javascript to work now but I wish that external js files would update too is there a plugin for this? I need a way to suggest Ideas? or vote on other ideas.

how does this, tie in node.js why is it needed? from what I've seen editing JS files, don't update on node.js  so what's the point of having node.js

 

0
Comment actions Permalink

>I wish that external js files would update too is there a plugin for this?

You can try hosting your app on web servers that support hot reloading. As I wrote, Live Edit doesn't update the application state, so only those changes in javascript that are triggered by event/timer are updated instantly, changes in code executed on page loading require refreshing

0
Comment actions Permalink

You can try hosting your app on web servers that support hot reloading. 

1. does xampp support it? does using it solve my problem?

------------------------------------------------------------------------------------------------------

2. where do I  go to submit suggestions / Bugs

0
Comment actions Permalink

1. AFAIK it doesn't support hot reloading out of the box, but you can try setting it up to use browsersync, for example - see https://codingreflections.com/browsersync-reload-localhost/

2. https://youtrack.jetbrains.com/issues/WI

0

Please sign in to leave a comment.