1

I´m working with Eclipse 3.4.2 with PDT. I´ve added some libraries in the applications folder, and add that folder to the PHP Include Path.

When I run as script, it works perfect, but if I access the page outside eclipse, the libraries are not accesible, i need to add this line:

set_include_path( implode(PATH_SEPARATOR, array(realpath('../application'), get_include_path(),)) );

Is this necesary? how can avoid this?

2 Answers 2

1

You may also specify path in include() statement, but it's not very convenient.

Also, you may specify corresponding include_path value in php.ini configuration file (see here for details), but usually this directive contains path to system-wide libraries, not application-specific paths.

If you are using OOP, you may implement your own class-loader, which will look for classes in specific directories. See this article for details.

Sign up to request clarification or add additional context in comments.

Comments

1

Yes. It is necessary. Because PHP interpreter should know, from what folders load libraries.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.