The first time THINKPHP was used, a path error was reported.

Source: Internet
Author: User
The first time I read the code written on the Internet: & lt ;? Phpdefine (& amp; #39; THINK_PATH & amp; #39;, & amp; #39; ThinkPHP & amp; #39;); define (& amp; #39; app_NAME & amp; #39;, & amp; #39; 43 & amp; #39;); define (& amp; #39 ;...

The first time I read the code written on the Internet:

  1. Define ('think _ path', 'thinkphp ');
  2. Define ('app _ name', '43 ');
  3. Define ('app _ path ','.');
  4. Require (THINK_PATH. '/ThinkPHP. php ');
  5. $ App = new App ();
  6. $ App-> run (); (this line can be avoided or the result will appear twice)
  7. ?>

Report error:

Warning: require (.. /ThinkPHPCommon/runtime. php) [function. require]: failed to open stream: No such file or directory in D: \ web \ htdocs \ ThinkPHP. php on line 36

Fatal error: require () [function. require]: Failed opening required '.. /ThinkPHPCommon/runtime. php '(include_path = '.; c: \ php5 \ pear ') in D: \ web \ htdocs \ ThinkPHP. php on line 36

View the information:

Are you using ThinkPHP 3?

Definition of the constant THINK_PATH:

ThinkPHP 2.x

Define ('think _ path', '../thinkphp ');

ThinkPHP 3.x

Define ('think _ path', '../ThinkPHP /');

Of course, you can not define ThinkPHP. ThinkPHP is really strange. we don't declare such a major change. Aren't we going to let people use it?

Later, I still couldn't do it. it seems that I only knew define ('think _ path', 'thinkphp'); I wrote less/define ('think _ path', 'thinkphp /'); that's right.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.