Linux + nginx application include cannot contain files?
Source: Internet
Author: User
Linux + nginx using include cannot contain files ???? For example, a sub-directory: under test, there is a file init. php sub-directory. under a folder, there is a class file a. class. phplinux + nginx. Using include, the file ???? The init. php code is as follows: define ('web _ linux + nginx using include cannot contain files ????
For example, a sub-directory: under test, there is a file init. php sub-directory. under a folder, there is a class file a. class. php
Linux + nginx using include cannot contain files ????
The init. php code is as follows:
Define ('web _ root', str_ireplace ('test', '', str_ireplace ('\', '/', dirname (_ FILE __))));
Include (web_root. 'A/a. class. php ');
$ Bb = new ();
Fatal error: Class 'A' not found in init. php on line x
However, it is normal to run in Windows + apahce + php5.2x on the local machine.
If you cannot use include, all my programs are paralyzed and cannot be run.
------ Solution --------------------
There is no final path character after dirname (_ FILE _)
So you include (web_root. 'A/a. class. php ');
Actually testa/a. class. php
Of course not.
You said that it is normal to run in Windows + apahce + php5.2x on the local machine.
Is irresponsible
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service