AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[laravel](ubuntu)

Martin Hope
LogGurkha
Asked: 2020-11-07 05:13:12 +0800 CST

如何将作曲家 1.6.3 更新到最新版本 2.0.4?

  • 2

我试图在 ubuntu 中更新我现有的作曲家版本。

我尝试检查版本,但 ubuntu 说找不到包。

然后我再次尝试sudo apt install composer安装作曲家。

现在当我检查作曲家的版本时。它显示 1.6.3,如果我尝试/home/alok/composer.phar,那么作曲家的版本是 2.0.4。

我很困惑。我应该怎么办?

请帮我解决这个问题。

updates laravel composer
  • 2 个回答
  • 7411 Views
Martin Hope
newbie
Asked: 2020-09-09 19:31:30 +0800 CST

如何解决由于包装损坏而未满足的依赖关系?[复制]

  • 2
这个问题在这里已经有了答案:
如何恢复默认存储库? (4 个回答)
无法纠正问题,你拿着坏了的包裹 (15个回答)
1 年前关闭。

(我刚从ubuntu 18.04 迁移到 Ubuntu 20.04。)

我无法理解的

  • 下面解释了我如何解决问题的过程和细节,但我真的不明白它所说的部分

php7.4-mysql : Depends: php7.4-common (= 7.4.3-4ubuntu2.2) but 7.4.9-1+ubuntu18.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.

  • 我可以理解该软件包php7.4-mysql取决于on php7.4-common(已安装,因此我看不到那里的问题),但它也说(= 7.4.3-4ubuntu2.2)然后我迷路了... 7.4.3-4ubuntu2.2?那是什么?如果这还不够复杂,它会增加......but 7.4.9-1+ubuntu18.04.1+deb.sury.org+1然后我就是不知道如何超越这个。

更多见解

  • 我知道有人问过类似的问题,我已经阅读了它们,并且发布的解决方案似乎无法解决我的问题。我正在尝试$ php artisan migrate在我自己的生产环境中使用该命令(我租用了一个主机,我只是在搞乱它),我得到了输出......

 Illuminate\Database\QueryException 

  could not find driver (SQL: select * from information_schema.tables where table_schema = gastigram and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
    667|         // If an exception occurs when attempting to run a query, we'll format the error
    668|         // message to include the bindings with SQL, which will make this exception a
    669|         // lot more helpful to the developer instead of just the database's errors.
    670|         catch (Exception $e) {
  > 671|             throw new QueryException(
    672|                 $query, $this->prepareBindings($bindings), $e
    673|             );
    674|         }
    675| 

      +34 vendor frames 
  35  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()
  • 我用谷歌搜索,他们说是缺少驱动程序的问题,有道理...它说那里缺少驱动程序,所以我尝试安装 php7.4-mysql 驱动程序,但后来...

$ sudo apt install php7.4-mysql 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.4-mysql : Depends: php7.4-common (= 7.4.3-4ubuntu2.2) but 7.4.9-1+ubuntu18.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.

由于包损坏,如何解决未满足的依赖关系的问题?

获得帮助

  • 我$ apt-cache policy php7.4-common按照@guiverc 的建议运行

这是输出

php7.4-common:
  Installed: 7.4.9-1+ubuntu18.04.1+deb.sury.org+1
  Candidate: 7.4.9-1+ubuntu18.04.1+deb.sury.org+1
  Version table:
 *** 7.4.9-1+ubuntu18.04.1+deb.sury.org+1 100
        100 /var/lib/dpkg/status
     7.4.3-4ubuntu2.2 500
        500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages
     7.4.3-4ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
php mysql laravel
  • 1 个回答
  • 2358 Views
Martin Hope
Jin
Asked: 2020-03-07 00:30:39 +0800 CST

如何在linux中重新启动apache服务器?[复制]

  • 0
这个问题在这里已经有了答案:
Apache 无法重启 12 个回答
2年前关闭。

我413 (Payload too large)在 ajax 帖子上的 laravel 项目中遇到错误。

现在我post_max_size & upload_max_filesize在php.ini我的 /etc/php/7.1/cli/php.ini.

现在我想重新启动apache server,因为我更新了php.ini文件。

我已经做到了

/etc/init.d/apache2 restart

并且仍然得到错误。

有什么遗漏吗?希望任何人都可以帮助我。谢谢

server php apache2 laravel
  • 4 个回答
  • 7018 Views
Martin Hope
Robert
Asked: 2020-03-04 06:35:51 +0800 CST

Ubuntu Laravel storage/logs/cron.log 权限被拒绝

  • 1

我有 Ubuntu 18.04、Laravel 和 PHP7.4。当我执行例如命令时,ls我有文件夹列表和:

user1@bpl:/var/www/html/storage$ ls
app  framework  logs
You have new mail in /var/mail/user1

当我这样做时,cat /var/mail/user1我有文件的内容:

From user1@bpl  Tue Mar  3 14:30:01 2020
Return-Path: <user1@bpl>
X-Original-To: user1
Delivered-To: user1@bpl
Received: by bpl (Postfix, from userid 1000)
        id 3264910126D; Tue,  3 Mar 2020 14:30:01 +0000 (UTC)
From: root@bpl (Cron Daemon)
To: user1@bpl
Subject: Cron <user1@bpl> $PHP $ARTISAN transaction:verify >> $LOGS 2>&1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <PHP=/usr/bin/php>
X-Cron-Env: <ARTISAN=/var/www/html/artisan>
X-Cron-Env: <LOGS=/var/www/html/storage/logs/cron.log>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/user1>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=user1>
Message-Id: <20200303143001.3264910126D@bpl>
Date: Tue,  3 Mar 2020 14:30:01 +0000 (UTC)

/bin/sh: 1: cannot create /var/www/html/storage/logs/cron.log: Permission denied

文件夹日志的权限如下所示:

user1@bpl:/var/www/html/storage$ ls -al
total 20
drwxrwxr-x  5 www-data www-data 4096 Feb 24 14:36 .
drwxr-xr-x 13 www-data www-data 4096 Feb 29 02:06 ..
drwxrwxr-x  3 www-data www-data 4096 Feb 28 15:13 app
drwxrwxr-x  6 www-data www-data 4096 Feb 24 14:36 framework
drwxrwxr-x  2 www-data www-data 4096 Mar  3 14:02 logs

任务事务验证来自 cron。此任务被添加到用户 cron。如何启用将这些日志写入此文件?

cron laravel logs
  • 1 个回答
  • 1600 Views
Martin Hope
Bardo
Asked: 2019-11-06 04:15:08 +0800 CST

403 尝试访问本地应用程序时出错

  • 1

我是第一次尝试深入研究 linux 开发的 IIS 男孩,所以请温柔一点。

好的,所以...我正在尝试配置我的工作站以在 laravel 上进行开发。

我在 Ubuntu 18.04 上,并且已经安装了 apache。我已经从 composer 安装了 laravel,并创建了第一个项目: composer create-project --prefer-dist laravel/laravel mySite "5.8.*"

这在 /etc/apache2/sites-enabled 上创建了一个名为 mySite 的 laravel 项目文件夹

我添加了一个新文件 /etc/apache2/sites-available/mySite.conf ,它看起来像这样:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName mySite
ServerAlias www.mySite
DocumentRoot /etc/apache2/sites-enabled/mySite/public/index.php
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined</VirtualHost>

之后,我在 /etc/apache2/apache2.conf 中添加了一行:

Include /etc/apache2/sites-available/mySite.conf

而且,当然,我已经将我的虚拟网站列入了同一个文件的白名单:

<Directory /etc/apache2/sites-available/mySite>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

我已经运行了 a2ensite 并重新启动了 apache。

但是,在尝试访问http://localhost/mySite或http://localhost/mySite/public/index.php时,我一直收到 403 错误(禁止访问。您无权访问此资源。) ,使用 127.0.0.1 而不是 localhost 会引发相同的错误。

欢迎对此问题的任何见解。

permissions php apache2 lamp laravel
  • 1 个回答
  • 1677 Views
Martin Hope
user271865
Asked: 2019-06-27 20:58:39 +0800 CST

为什么 laravel api.php 路由会出现 404 错误?

  • 0

我在 Ubuntu 18.04 中使用 laravel 5.8.24 这是我第一次编写 API。我将在这里添加一个测试代码。

路线/api.php

Route::get('/api',function(){
    return "Test api";
});

当我去http://my_localhost_link/api它给出一个404错误

路线routes/web.php运行良好。

谁能告诉我我错过了什么或出了什么问题?谢谢你。

laravel 18.04 php7
  • 4 个回答
  • 13475 Views
Martin Hope
qotsa42
Asked: 2018-06-23 17:43:04 +0800 CST

php artisan migrate无法访问mysql数据库[重复]

  • 3
这个问题在这里已经有了答案:
无法从 ubuntu 16.04 中的普通用户帐户以 mysql 用户 root 身份登录 11 个答案
4年前关闭。

这类似于这个问题,但我的情况有点不同。

我在 Ubuntu 18.04 上运行 laravel、composer 和 valet。我正在尝试运行php artisan migrate,它会引发与无法连接到 mysql 数据库相关的错误。

 Illuminate\Database\QueryException  : SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select * from information_schema.tables where table_schema = blog and table_name = migrations)

at /home/david/Sites/blog/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
  660|         // If an exception occurs when attempting to run a query, we'll format the error
  661|         // message to include the bindings with SQL, which will make this exception a
  662|         // lot more helpful to the developer instead of just the database's errors.
  663|         catch (Exception $e) {
> 664|             throw new QueryException(
  665|                 $query, $this->prepareBindings($bindings), $e
  666|             );
  667|         }
  668| 

Exception trace:

1   PDOException::("SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'")
    /home/david/Sites/blog/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68

2   PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=blog", "root", "", [])
    /home/david/Sites/blog/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68

我似乎很清楚 .env 文件不包含正确的信息……但确实如此。这是我的 .env 用于 mysql 数据库:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=blog
DB_USERNAME=root
DB_PASSWORD=

我尝试进入的数据库名为 blog,用户名为 root,密码为空。这就是我在我的机器上访问 mysql 的方式......sudo mysql -uroot -p它让我直接登录。

知道可能出了什么问题吗?

mysql laravel
  • 1 个回答
  • 11432 Views
Martin Hope
Intellect
Asked: 2018-04-02 16:36:03 +0800 CST

Ubuntu 上的 Laravel

  • 0

我已经成功创建了一个 laravel 5 项目。我创建了一条到test.test/me. 如果我test.test在浏览器中访问,它将显示 laravel 主页。但是如果我访问test.test/me浏览器会显示

未找到

在此服务器上找不到请求的 URL /me。

但是,如果我使用php artisan serve命令并使用 php 服务器,路由localhost:8000/将显示我的路由。我不知道该怎么办。

我运行 Ubuntu 16.04 LTS 并使用 Apache 服务器。有人可以帮忙吗?请帮助维持开发人员的雄心壮志。

server apache2 laravel
  • 1 个回答
  • 2617 Views
Martin Hope
Gaurav Gupta
Asked: 2018-01-30 21:55:06 +0800 CST

无法在 ubuntu 17.10 上安装 php7.1-bcmath

  • 3

我正在尝试安装 Laravel 包名称bitwasp但此包依赖于bcmath. 每当我尝试安装时,它都会给我一个错误。我也尝试使用以下命令安装它:

sudo apt-get install php7.1-bcmath

但每当我这样做时,我的 Ubuntu 也是 17.10 时出现以下错误:

After this operation, 128 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-gd amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:2 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-bz2 amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:3 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-opcache amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:4 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-json amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:5 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-mcrypt amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:6 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-zip amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:7 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-curl amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:8 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-xml amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:9 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-mbstring amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:10 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-mysql amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:11 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-readline amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:12 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 libapache2-mod-php7.1 amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:13 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-cli amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:14 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-common amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
Err:15 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php7.1-bcmath amd64 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-gd_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-bz2_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-opcache_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-json_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-mcrypt_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-zip_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-curl_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-xml_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-mbstring_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-mysql_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-readline_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/libapache2-mod-php7.1_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-cli_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-common_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-bcmath_7.1.12-2+ubuntu17.10.1+deb.sury.org+2_amd64.deb  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

已经运行update并且fix-missing没有任何反应,每次我遇到同样的错误。

php 17.10 laravel
  • 3 个回答
  • 11707 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve