我想在cPanel的航站楼上做cPanel。它总是显示“符号链接():没有这样的文件或目录”。
我还尝试了在路由上调用Artisan的方法:Route::get('/tes', function() { Artisan::call('storage:link'); });。问题还是一样的。
删除public_html上的文件夹存储并执行php artisan storage:link,但仍然无法工作。
在app->providers->AppServiceProvider.php上添加函数寄存器():
$this->app->bind('path.public', function() {
return base_path('../public_html');
});这是我在文件夹public_html上的public_html。
require __DIR__.'/../laravel/vendor/autoload.php';
$app = require_once __DIR__.'/../laravel/bootstrap/app.php';文件夹结构视图:在这里输入图像描述
文件夹laravel视图:在这里输入图像描述
文件夹public_html视图:在这里输入图像描述
我成功地完成了这个ln -s /path/to/target /path/to/shortcut,但我认为它并不完美。因为链接必须显示存储。如果我成功地使用了php artisan storage:link,这个链接就不需要显示存储。类似于example.com/storage/folderimage/abc.jpg和example.com/folderimage/abc.jpg
发布于 2022-08-31 08:29:18
根据图片:https://i.stack.imgur.com/OPukb.png,我看不到laravel目录中的公用文件夹。
以下步骤将修复问题inChaAllah:
public/storage目录。 $ cd laravel
$ php artisan storage:linkstorage的符号链接是在laravel/public目录中创建的。
laravel/public/目录的内容复制到public_html中。public_html/index.php中更新laravel应用程序的路径path.public在AppServiceProvider.php中的绑定。https://stackoverflow.com/questions/73552734
复制相似问题