Mathieu Turcotte Mathieu Turcotte - 11 months ago 55
PHP Question

Class not found - PHP server config?

So I'm working from a laptop, and I'm developing a PHP application. Being allowed to work from home, I installed EasyPHP on the laptop so I can host the web application locally on the laptop and work even when not connected to the internet, and without the use for a VPN connection, and even for when I'm at work, no need to mess with FileZilla or whatever, everthing will be so much easier like that for me.

My problem is the following: from our dev server, at work, everything is good. I copied the whole code in my easyphp folder, and I make a duplicate of my database in my local MySQL server. Running the application on my work's dev server, everything is fine. But locally, I get the following error:

Fatal error: Class 'ConfigNamespace' not found in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\MyApplication\libs\config\ConfigParser.php on line 50

So my ConfigParser class calls a New ConfigNamespace() at line 50... The local server doesn't like it. The ConfigNamespace class sits next to the ConfigParser class, in the \libs\config folder. Why does t not work locally, but works on the dev server?

I am under the impression that the configuration of the servers are different, and that my local server decides to expect all the classes to be in the root folder... but it's not!

I've searched on the web but only found things regarding system classes being unreachable... nothing that really has anything to do with my problem.


Answer Source

Wow, downvote? Really? That was a legit problem... To whoever downvoted it, just because you can't answer doesn't mean the question isn't good...

Anyway, I fixed it, it ended up being a problem with rights on the folders after all. I did give it all the rights, but windows somehow still blocked it... I changed my document root for another folder, not in program files, and now everything works!