1

The website Javascript and CSS is not working because included path seems not work, PHPStorm shows that path not found. But the path is correct as image 1: index.php.png

I think the problem is APP_DIR, removed it and PHPStorm did not highlight the path anymore.

As image 2:
no highlight

But I cannot remove the APP_DIR because it link to many files including CSS. Been trying for 3 days and I have no idea, help me please.

saurabh kamble
  • 1,510
  • 2
  • 25
  • 42
JosephMon
  • 11
  • 3
  • Not sure what the code hint exactly shows: a) APP_DIR is not defined or b) APP_DIR has no trailing slash ? – VolkerK Jan 06 '16 at 04:21
  • IDEs are not really good at resolving dynamic paths. Try running the script, what does it show? Any error? – Nijraj Gelani Jan 06 '16 at 04:22
  • i think you should try include_once(APP_DIR.'/conf/site.php') – jilesh Jan 06 '16 at 04:45
  • My apologies and sorry to everyone who tried to help me, I've given up on this. I'd uploaded the source code(50mb) if anyone want to try it. Thanks. https://goo.gl/kaZeDa – JosephMon Jan 19 '16 at 07:23

1 Answers1

0

For debugging purposes please try

if ( !defined('APP_DIR') ) {
    trigger_error('APP_DIR not defined', E_USER_ERROR);
}

if ( substr(APP_DIR, -1)!=='/' && substr(APP_DIR, -1)!=='\\' ) {
    trigger_error("APP_DIR has no trailing slash. APP_DIR.'conf/....' wont work, but APP_DIR.'/conf/...' might");
}

/** Configuration of SI */
include_once APP_DIR.'conf/site.php';
VolkerK
  • 95,432
  • 20
  • 163
  • 226
  • Sorry VolkerK, I appreciate your help. I've given up on this. I'd uploaded the source code(50mb) if you want to try it. Thanks. https://goo.gl/kaZeDa – JosephMon Jan 19 '16 at 07:25