如何在Bluehost或安装了旧版本ICU的任何其他服务器上安装Sylius? [英] How do I install Sylius on Bluehost or any other server that has an old version of ICU installed?

查看:107
本文介绍了如何在Bluehost或安装了旧版本ICU的任何其他服务器上安装Sylius?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在共享主机上运行的Bluehost服务器上安装Sylius,尽管我确实具有SSH访问权限,但它受到一定限制。它没有附带php intl扩展,它的ICU版本是4.2,由于需要新版本,因此在安装Sylius时会产生错误。

I have been trying to get Sylius installed on my Bluehost server which is running on shared hosting and while I do have SSH access, it is somewhat limited. It did not come with the php intl extension and the version of ICU on it is 4.2 which produces errors when installing Sylius because it wants a newer version.

推荐答案

我在Bluehost服务器上全新安装的Sylius上尝试了此操作,然后使其正常工作。

I tried this on a clean install of Sylius on my Bluehost server and got it to work.

我以前安装了 https://my.bluehost之后,在我的BlueHost服务器上> intl 扩展名。 com / cgi / help / 534

I had previously installed the intl extension on my BlueHost server following https://my.bluehost.com/cgi/help/534

不需要 intl 扩展名。见下文。 (在我意识到自己不需要它之前,我曾尝试安装它)。

The intl extension is not required. See below. (I was attempting to install it before I realized I didn't need it)

安装扩展程序后,phpinfo()表示ICU的版本为4.2。

After installing the extension, phpinfo() said the version of ICU was 4.2.

注意:在BlueHost上,您必须使用 php-cli 而不是 php 从命令行运行php脚本

Note: on BlueHost you have to use php-cli instead of php to run php scripts from the command line

要安装Sylius,我运行了:

To install Sylius I ran:

wget http://getcomposer.org/composer.phar
php-cli composer.phar create-project sylius/sylius -s dev

运行创建项目时,收到错误消息:

When running create-project, I recieved the error:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for symfony/icu 1.2.x-dev -> satisfiable by symfony/icu[1.2.x-dev].
- symfony/icu 1.2.x-dev requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
Problem 2
- symfony/icu 1.2.x-dev requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
- symfony/intl 2.3.x-dev requires symfony/icu >=1.0-RC,<2.0 -> satisfiable by symfony/icu[1.2.x-dev].
- Installation request for symfony/intl 2.3.x-dev -> satisfiable by symfony/intl[2.3.x-dev].

然后我用 cd sylius 进入

来自 http://symfony.com/doc/current/components/intl.html 我添加了 symfony / icu: 1.1 。*,(如果没有 symfony / icu: 1.0。*, > intl 扩展安装)到composer.json的require部分

From the section on http://symfony.com/doc/current/components/intl.html about ICU and deployment problems I added "symfony/icu": "1.1.*", (or add "symfony/icu": "1.0.*", if you do not have the intl extension installed) to the require section of composer.json

然后我运行了 php-cli composer.phar更新以获取所有需要一段时间的依赖项(确保将composer.phar下载到父目录中时正确引用了它)

I then ran php-cli composer.phar update to get all the dependencies which takes a while (make sure you reference composer.phar correctly as it was downloaded into the parent directory)

下载所有软件包后,它询问配置参数,例如数据库信息

After all the packages were downloaded, it asked for config parameters such as Database info

然后我运行了 php-cli app / console sylius:install

我运行了 php-cli应用程序/控制台学说:f ixtures:load 并收到错误:

[RuntimeException]
The country resource bundle could not be loaded for locale "en"

来自 https://github.com/symfony/symfony/issues/5279#issuecomment-12477297 https://github.com/kbsali/sf2-icu 我跑过

wget https://github.com/kbsali/sf2-icu/tarball/master -O sf2-icu.tgz
tar xzvf sf2-icu.tgz
mv kbsali-sf2-icu-XXXX/4.2 vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/data/
rm -rf kbsali-sf2-icu-XXXX sf2-icu.tgz

然后编辑供应商/ symfony / symfony / src / Symfony / Component /Locale/Locale.php 并更改

const ICU_DATA_VERSION = '49';

const ICU_DATA_VERSION = '4.2';

我运行了 php-cli应用程序/控制台doctrine:fixtures:load 再次加载所有数据夹具,直到LoadOrdersData失败并显示错误:

I ran php-cli app/console doctrine:fixtures:load again and loaded all of the Data Fixures until LoadOrdersData failed with the error:

[ErrorException]
Warning: array_keys() expects parameter 1 to be array, object given in /home5/ozzieorc/public_html/sylius_clean/sylius/vendor/fzaninotto/faker/src/Faker/Provider/Base.php line 127

然后进行了 https://github.com/Sylius/Sylius/pull/216/files -希望它成为master分支的一部分,并且在安装sylius

Then made the changes described at https://github.com/Sylius/Sylius/pull/216/files - hopefully this becomes part of the master branch and doesn't have to be changed when installing sylius

并第三次运行 php-cli app / consolerine:fixtures:load

我将IP添加到了 web / app_dev.php 中的有效IP地址数组中,因此我可以从BlueHost服务器远程运行app_dev.php

I added my IP to the array of valid IP addresses in web/app_dev.php so I can run app_dev.php remotely from the BlueHost servers

在您的浏览器中,可以转到 web / app_dev.php 并使用

In your browser you can go to web/app_dev.php and login to the admin area with

Username: sylius@example.com
Password: sylius

根据页面提示

希望这可以帮助任何在安装Sylius时遇到问题的人。我花了一段时间才弄清楚。让我知道是否有更好的方法可以解决这个问题。

Hopefully this helps anyone having problems with installing Sylius. It took me a while to figure it out. Let me know if there are any better ways of going about this.

这篇关于如何在Bluehost或安装了旧版本ICU的任何其他服务器上安装Sylius?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆