PHP include absolute path

You can’t include php files relatively to your webroot that way, cause if you use the slash as first character, the reference will go much deeper than just your document root. So, instead of using your basepath, you could do something like this : <?php $path = $_SERVER[‘DOCUMENT_ROOT’]; $path .= “/yourpath/yourfile.php”; include_once($path); ?>

How to make g++ search for header files in a specific directory?

A/code.cpp #include <B/file.hpp> A/a/code2.cpp #include <B/file.hpp> Compile using: g++ -I /your/source/root /your/source/root/A/code.cpp g++ -I /your/source/root /your/source/root/A/a/code2.cpp Edit: You can use environment variables to change the path g++ looks for header files. From man page: Some additional environments variables affect the behavior of the preprocessor. CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH Each variable’s value is a list of … Read more

vscode “#include errors detected. Please update your includePath

Although the question mentions Arduino, the following suggestions apply basically any time VSCode tells you to “update your includePath”. What is includePath? The includePath is an attribute in c_cpp_settings.json, which is in the .vscode folder of the main folder you have opened in VSCode using File → Open Folder. You can edit c_cpp_settings.json directly, but … Read more

python pip specify a library directory and an include directory

pip has a –global-option flag You can use it to pass additional flags to build_ext. For instance, to add a –library-dirs (-L) flag: pip install –global-option=build_ext –global-option=”-L/path/to/local” pyodbc gcc supports also environment variables: http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html I couldn’t find any build_ext documentation, so here is the command line help Options for ‘build_ext’ command: –build-lib (-b) directory for … Read more