OroPlatform安装配置
安装PHP
安装依赖包:
apt install \ jpegoptim \ libc-client2007e-dev \ libcurl4-openssl-dev \ libkrb5-dev \ libmysqlclient-dev \ libonig-dev \ libpq-dev \ libreadline-dev \ libsasl2-dev \ libsodium-dev \ libtidy-dev \ libxml2-dev \ libzip-dev \ pngquant
编译安装PHP:
wget https://www.php.net/distributions/php-8.0.12.tar.gz tar xf php-8.0.12.tar.gz cd php-8.0.12 ./configure \ --prefix=$HOME/.local \ --enable-bcmath \ --enable-fpm \ --enable-gd \ --enable-intl \ --enable-mbstring \ --enable-pcntl \ --enable-soap \ --with-curl \ --with-kerberos \ --with-imap \ --with-imap-ssl \ --with-ldap \ --with-ldap-sasl \ --with-openssl \ --with-pdo-mysql \ --with-pdo-pgsql \ --with-readline \ --with-sodium \ --with-tidy \ --with-zip make -j8 make install
配置PHP
sed \ -e 's/^memory_limit = .*/memory_limit = 4096M/' \ -e 's/^;zend_extension=.*/zend_extension=opcache/' \ -e 's/^;opcache.enable=.*/opcache.enable=1/' \ -e 's/^;opcache.enable_cli=.*/opcache.enable_cli=0/' \ php.ini-development > $HOME/.local/lib/php.ini
安装Composer
wget https://getcomposer.org/download/2.1.9/composer.phar chmod +x composer.phar mv composer.phar $HOME/.local/bin/composer composer config -g repos.packagist composer https://mirrors.aliyun.com/composer/
安装Node.js
wget https://nodejs.org/dist/v14.18.1/node-v14.18.1-linux-x64.tar.xz tar xf node-v14.18.1-linux-x64.tar.xz ln -s $PWD/node-v14.18.1-linux-x64/bin/{node,npm} $HOME/.local/bin npm config set registry https://registry.npm.taobao.org
创建数据库
echo "CREATE ROLE oro WITH LOGIN PASSWORD 'oro'; CREATE DATABASE oroplatform WITH OWNER oro" | psql postgres postgres
安装依赖及配置
cd oroinc/platform-application sed \ -e 's/database_driver:.*/database_driver: pdo_pgsql/' \ -e 's/database_host:.*/database_host: 127.0.0.1/' \ -e 's/database_port:.*/database_port: 5432/' \ -e 's/database_name:.*/database_name: oroplatform/' \ -e 's/database_user:.*/database_user: oro/' \ -e 's/database_password:.*/database_password: oro/' \ config/parameters.yml.dist > config/parameters.yml rm package-lock.json composer install
安装OroPlatform
php bin/console oro:install \ --application-url=http://localhost:8000/ \ --formatting-code=en_US \ --language=en \ --organization-name=ORO \ --sample-data=n \ --skip-translations \ --user-email=admin@example.com \ --user-firstname=Xin \ --user-lastname=Wang \ --user-name=admin \ --user-password=admin
启用服务
php -S localhost:8000 -t public
访问
http://localhost:8000/index_dev.php