Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はたくさんのサイトを持っています-すべて私のサーバーでホストされています。ドメインがリンクされているhttpdocsの上のディレクトリである/vhostからファイルにアクセスするようにそれらの1つが必要です。
httpd.confにパスを変更するオプションがあることは知っていますが、それは私のサイトのすべてのインクルードを変更するための多くの作業です。
関数ini_set()を使用します。たとえば、PHPのinclude_pathを「。:../:./include:../include」に設定する場合は、PHPコードで次のようにします。
ini_set("include_path", ".:../:./include:../include");
ini_set()を使用して、auto_prepend_file、auto_append_file、error_reportingなどの他のPHP設定に影響を与えることもできます。