安装过程问题
../vendor/magento/framework/Code/Generator.php on line 103报错
这一报错通常出现在安装或升级Magento 2的时候,这时请尝试为根目录下的var文件夹设置 可写权限。以下为通过Mac的XAMPP安装时的完整报错信息:
Fatal error: Uncaught exception 'Magento\Framework\Exception\LocalizedException' with message 'Can't create directory /Applications/XAMPP/xamppfiles/htdocs/magento2/var/generation/Magento/Framework/App/ResourceConnection/.' in /Applications/XAMPP/xamppfiles/htdocs/magento2/vendor/magento/framework/Code/Generator.php:103 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/magento2/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\Framewo...') #1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\Framewo...') #2 [internal function]: spl_autoload_call('Magento\Framewo...') #3 /Applications/XAMPP/xamppfiles/htdocs/magento2/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\Framewo...') #4 /Applications/XAMPP/xamppfiles/htdocs/magento2/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo...') #5 /Ap in /Applications/XAMPP/xamppfiles/htdocs/magento2/vendor/magento/framework/Code/Generator.php on line 103
missing PHP extensions intl.
很明显是缺失PHP组件,那么如何安装呢,先执行如下指令
cd ~ && curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz tar -zxvf autoconf-latest.tar.gz cd autoconf-2.69 ./configure make sudo make install
安装过程可能会提示安装XCode或M4相关软件,请确认安装即可。下一步就是安装intl组件
sudo pecl install intl
安装后还需要在php.ini中加入组件的引用
sudo nano /Applications/XAMPP/xamppfiles/etc/php.ini extension=intl.so //加入并保存
重启XAMPP中的Apache再次执行检查报错应该就会消失了
登录错误
You did not sign in correctly or your account is temporarily disabled.
1 2 3 4 5 6 7 8 |
# 修改密码 # MySQL命令行,xxx 为app\etc\env.php中的 key UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxYourNewPassword', 256), ':xxxxxxx:1') WHERE username = 'ADMINUSERNAME'; # 或命令行 sudo php bin/magento admin:user:create --admin-user="xxxxx" --admin-password="xxxxx" --admin-email="xxx@gmail.com" --admin-firstname="Admin" --admin-lastname="Admin" # 解锁用户 php bin/magento admin:user:unlock ADMINUSERNAME |
开发者模式
1 2 3 4 5 6 7 8 9 |
# 当前模式查看 bin/magento deploy:mode:show bin/magento deploy:mode:set {mode} [-s|--skip-compilation] # 如 bin/magento deploy:mode:set developer # 配置文件app/etc/env.php 'MAGE_MODE' => 'default', |
An error has happened during application run. See exception log for details. Could not write error message to log. Please use developer mode to see the message.
1 |
php bin/magento cache:flush |