亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

php - class not found?
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-05-16 13:12:17
0
3
819

I am trying NetEase Hive's object storage. According to the documentation, the folder structure on the vps is now like this:

< /p>

index.php looks like this:

<?php
require_once __DIR__ . '/vendor/autoload.php';

use NOS\NosClient;
use NOS\Core\NosException;

$accessKeyId = "xxxxxxxxxxxxxx";
$accessKeySecret = "xxxxxxxxxxxxxxxxxxxx";
$endPoint = "nos-eastchina1.126.net";
$bucket = "testtest1";

try{
        $nosClient = new NosClient($accessKeyId,$accessKeySecret,$endPoint);
        $nosClient->createBucket($bucket);
} catch(NosException $e){
        print $e->getMessage();
}

When running, it prompts: Fatal error: Class 'NOS\NosClient' not found in /data/wwwroot/default/index.php on line 14

But there is no problem when I put these in my local test. Am I missing something?
Please help me, thank you very much.

Update:
It was a problem with the NOS package itself. According to their customer service, the problem was solved after using a new package.

PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證高級(jí)PHP講師

reply all(3)
世界只因有你

Because it is ok when you test it locally, it proves that the composer configuration is used correctly

  1. Check the running environment composer installation and permissions, and try writing a simple example

  2. Check the composer install execution results in the running environment

  3. What you should use is netease/nos-php-sdk. According to its configuration file, it uses the psr4 standard

  4. View./vendor/composer/autoload_psr4.php

  5. If the problem is not found above, it is recommended to modify ./vendor/autoload.php./vendor/composer/*文件打logdebugging to see where the problem is specifically

曾經(jīng)蠟筆沒有小新

Classes are missing. Check whether there is a corresponding class under the corresponding namespace. If not, just introduce it

給我你的懷抱

There are no dependencies to install the project on the server
The first step is to install composer first,
The second step is composer install to install the dependencies defined in composer.json

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template