OLAINDEX

折腾 19 天前

请输入图片描述

这玩意还真不是这么容易弄,每一步都能碰到意想不到的问题。

PHP 准备

  1. 编辑/usr/local/php/etc/php.ini

    proc_open、proc_get_status、exec、shell_exec
  2. 安装 fileinfo 扩展

  3. 重启 PHP 服务

    service php-fpm restart

安装 Composer

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

程序准备

git clone https://github.com/WangNingkai/OLAINDEX.git tmp 
mv tmp/.git . 
rm -rf tmp 
git reset --hard 
composer install -vvv

cp database/database.sample.sqlite database/database.sqlite
cp storage/app/example.config.json storage/app/config.json

chmod 777 storage/app/config.json    // 解决安装报错 403
chmod -R 755 storage/               // 解决填写机密后一步的重复输入
chown -R www:www *
php artisan od:install               // 前缀写上 http(s)://

Nginx 配置

root xx.com/public;
...
location / {
 try_files $uri $uri/ /index.php?$query_string;
}
...

命令

// 重置数据
php artisan od:reset

// 重置 OneDrive 登陆账号
php artisan od:logout

// 清除缓存,常用
php artisan config:cache

// 升级程序
git pull 
composer update -vvv
chmod -R 755 storage/
chown -R www:www *

配置 composer 镜像

// 当前项目生效
composer config repo.packagist composer https://mirrors.aliyun.com/composer/

// 取消当前项目配置
composer config --unset repos.packagist

// 全局配置生效
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

// 取消全局配置
composer config -g --unset repos.packagist

// 其它 composer 镜像
composer        https://packagist.org
phpcomposer     https://packagist.phpcomposer.com
aliyun          https://mirrors.aliyun.com/composer
tencent         https://mirrors.cloud.tencent.com/composer
huawei          https://mirrors.huaweicloud.com/repository/php
laravel-china   https://packagist.laravel-china.org
cnpkg           https://php.cnpkg.org
sjtug           https://packagist.mirrors.sjtug.sjtu.edu.cn
Top