Saturday, May 7, 2016

[Laravel5][Resolved] Error include_path='. /usr/share/pear /usr/share/php'

Version : Laravel 5.0
OS : CentOS 7 

source :
<?php
namespace App\Http\Controllers;

use Mail;
use App\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use LibsName\LibsName;

class ClassName extends Controller
{

    public function sendXxxxXxxxx(Request $request)
    {
        require 'App/Libraries/LibsName/vendor/autoload.php'; //error from this line
        echo "hello!!! ";
    }
}
?>
Value after the word "require" is path of php file, it's case sensitive. After i corrected the value from 'App/Libraries/LibsName/vendor/autoload.php'; to 'app/Libraries/LibsName/vendor/autoload.php'; , the application able to load the require file and then problem solved.

    public function sendXxxxXxxxx(Request $request)
    {
        require 'app/Libraries/LibsName/vendor/autoload.php'; //error from this line
        echo "hello!!! ";
    }

Reference:

http://stackoverflow.com/questions/23186952/error-in-exception-handler-laravel
http://php.net/manual/en/function.require.php

No comments :

Post a Comment