将 Laravel 项目复制到新设备后,PhpStorm 不会加载它们
Posted
技术标签:
【中文标题】将 Laravel 项目复制到新设备后,PhpStorm 不会加载它们【英文标题】:PhpStorm does not load Laravel projects after copying them into new device 【发布时间】:2021-08-10 22:23:21 【问题描述】:我刚刚在我的笔记本电脑上安装了最新的 XAMPP,并将我的 PC 系统的 htdocs
项目复制并粘贴到这个新的 XAMPP htdocs
中。
然后尝试在 phpStorm 中打开它们,但是当我在这里的任何项目上运行 php artisan serve
时,我收到以下错误:
PHP Warning: Failed to load F:\xampp\php\ext\php_xdebug-2.9.7-7.4-vc15-x86_64.dll, The system cannot find the file specified.
in Unknown on line 0
Warning: Failed to load F:\xampp\php\ext\php_xdebug-2.9.7-7.4-vc15-x86_64.dll, The system cannot find the file specified.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'bz2' (tried: F:\xampp\php\ext\bz2 (The specified module could not be found.), F:\xampp\php\ext\php_bz2.d
ll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'bz2' (tried: F:\xampp\php\ext\bz2 (The specified module could not be found.), F:\xampp\php\ext\php_bz2.dll (T
he specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: F:\xampp\php\ext\curl (The specified module could not be found.), F:\xampp\php\ext\php_cur
l.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: F:\xampp\php\ext\curl (The specified module could not be found.), F:\xampp\php\ext\php_curl.dll
(The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'fileinfo' (tried: F:\xampp\php\ext\fileinfo (The specified module could not be found.), F:\xampp\php\ext
\php_fileinfo.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'fileinfo' (tried: F:\xampp\php\ext\fileinfo (The specified module could not be found.), F:\xampp\php\ext\php_
fileinfo.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'gd2' (tried: F:\xampp\php\ext\gd2 (The specified module could not be found.), F:\xampp\php\ext\php_gd2.d
ll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'gd2' (tried: F:\xampp\php\ext\gd2 (The specified module could not be found.), F:\xampp\php\ext\php_gd2.dll (T
he specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'gettext' (tried: F:\xampp\php\ext\gettext (The specified module could not be found.), F:\xampp\php\ext\p
hp_gettext.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'gettext' (tried: F:\xampp\php\ext\gettext (The specified module could not be found.), F:\xampp\php\ext\php_ge
ttext.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mbstring' (tried: F:\xampp\php\ext\mbstring (The specified module could not be found.), F:\xampp\php\ext
\php_mbstring.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'mbstring' (tried: F:\xampp\php\ext\mbstring (The specified module could not be found.), F:\xampp\php\ext\php_
mbstring.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'exif' (tried: F:\xampp\php\ext\exif (The specified module could not be found.), F:\xampp\php\ext\php_exi
f.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'exif' (tried: F:\xampp\php\ext\exif (The specified module could not be found.), F:\xampp\php\ext\php_exif.dll
(The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: F:\xampp\php\ext\mysqli (The specified module could not be found.), F:\xampp\php\ext\php
_mysqli.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: F:\xampp\php\ext\mysqli (The specified module could not be found.), F:\xampp\php\ext\php_mysq
li.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: F:\xampp\php\ext\pdo_mysql (The specified module could not be found.), F:\xampp\php\e
xt\php_pdo_mysql.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: F:\xampp\php\ext\pdo_mysql (The specified module could not be found.), F:\xampp\php\ext\ph
p_pdo_mysql.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: F:\xampp\php\ext\pdo_sqlite (The specified module could not be found.), F:\xampp\php
\ext\php_pdo_sqlite.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: F:\xampp\php\ext\pdo_sqlite (The specified module could not be found.), F:\xampp\php\ext\
php_pdo_sqlite.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_openssl.dll' (tried: F:\xampp\php\ext\php_openssl.dll (The specified module could not be found.), F:
\xampp\php\ext\php_php_openssl.dll.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'php_openssl.dll' (tried: F:\xampp\php\ext\php_openssl.dll (The specified module could not be found.), F:\xamp
p\php\ext\php_php_openssl.dll.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'php_ftp.dll' (tried: F:\xampp\php\ext\php_ftp.dll (The specified module could not be found.), F:\xampp\p
hp\ext\php_php_ftp.dll.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'php_ftp.dll' (tried: F:\xampp\php\ext\php_ftp.dll (The specified module could not be found.), F:\xampp\php\ex
t\php_php_ftp.dll.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: Cannot open 'F:\xampp\php\extras\browscap.ini' for reading in Unknown on line 0
Warning: Cannot open 'F:\xampp\php\extras\browscap.ini' for reading in Unknown on line 0
PHP Fatal error: Unable to start standard module in Unknown on line 0
Fatal error: Unable to start standard module in Unknown on line 0
有趣的是我没有安装 XAMPP 并驱动 F:\
。但正如您在这些错误消息中看到的,消息来自F:\
目录,这是我 PC 系统上 XAMPP 的目录。
Cannot open 'F:\xampp\php\
那么为什么我会收到这些错误消息?如何正确运行我的 Laravel 项目而不会出现这些错误?
我非常感谢你们的任何想法或建议,因为我的生活依赖于此!
【问题讨论】:
PHPStorm
是一个 IDE,而不是 Web 服务器或 PHP 处理器,尽管它可以将信息传递给一个。这与 xampp 的关系比 PHPStorm 更多
@aynber 但是我可以在我的项目目录中使用 CMD 运行命令
@user2819411 然后在 PhpStorm 中检查 PHP Interpreter
- 也许它指向错误的 PHP 可执行文件等。到目前为止(基于错误)它是 PHP 问题而不是 PhpStorm。您需要提供更多详细信息/清楚您的设置。
@user2819411 运行php -v
看看它是否会产生任何错误。在您的终端(不在 PhpStorm 中)运行您的php artisan serve
——它在那里工作吗?也许你已经跨系统复制了你的 PHP 配置......
@user2819411 "如何检查 phpstorm 的 php 解释器?" 打开 PhpStorm Settings/Preferences 并在搜索框中输入 php interpreter
? jetbrains.com/help/phpstorm/configuring-local-interpreter.html 现在看起来您的系统中可能有多个 PHP,并且您的系统终端使用一个,而在 PhpStorm 中它使用另一个。您最好了解您的系统设置及其在其中的工作方式。现在我可能只建议重新启动整个计算机:它通常会有所帮助。
【参考方案1】:
看起来像是 PHP 问题,而不是 IDE 问题。
您是否尝试过启用 php.ini 中的错误中提到的扩展?并尝试全局安装PHP,这样可以避免在执行PHP命令时出现与xampp目录相关的问题。
【讨论】:
以上是关于将 Laravel 项目复制到新设备后,PhpStorm 不会加载它们的主要内容,如果未能解决你的问题,请参考以下文章
如何使用 PowerShell 可靠地将项目复制到 mtp 设备?
AppleTv 正忙:AppleTv 完成后,将继续从设备 Xcode 复制缓存文件