douwei1944
douwei1944
2017-02-25 18:21
浏览 216
已采纳

Windows Server上的Laravel:main():打开所需的失败...(include_path ='。; C:\ php \ pear')

I am using Laravel 5.2 on Windows Server (IIS), and in my controller (app\Http\Controllers\Test\NewsletterController.php) I need to require a file:

require_once dirname(__FILE__) . '../../../Mailwizz/setup.php';

(this file is stored in app\Mailwizz\setup.php).

But I am getting the following error:

main(): Failed opening required 'C:\inetpub\vhosts\example.com\app\Http\Controllers\Test
../../../Mailwizz/setup.php' (include_path='.;C:\php\pear')

Maybe it has something to do with include_path in php.ini, but I'm not sure how to setup this on Windows Server... here is my current php.ini:

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
;
; PHP's default setting for include_path is ".;/path/to/php/pear"
; http://php.net/include-path

Do you know how can I fix this?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doubinduo3364
    doubinduo3364 2017-02-25 18:26
    已采纳

    Replace

    require_once dirname(__FILE__) . '../../../Mailwizz/setup.php';
    

    with

    require_once dirname(__FILE__) . '/../../../Mailwizz/setup.php';
    

    I think that you error is caused by missing slash.

    点赞 评论

相关推荐