简体   繁体   中英

Installing symfony with composer gives error

I have a arch linux droplet that I am trying to install symfony on. I got composer installed so I went to the directory I wanted the installation to go to and typed the composer create-project symfony/framework-standard-edition path/ 2.4.2 command. Then I got this error. This confuses me because it says that even though its right there in the list. Can someone help me find out how to fix this issue?

I restarted httpd after the change as well.

[ErrorException]
  file_exists(): open_basedir restriction in effect. File(/root/.composer/.htaccess) is not within the allowed p
  ath(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/usr/local/bin/:/root/.composer/.htacces
  s/)

It looks like you've attempted to add the right directory to the open_basedir allowed paths as I see /root/.composer/.htaccess in the list. The problem is, this list should only contain existing directories.

A quick fix would be to change that entry to simply /root as Composer will then attempt to create .composer and .composer/.htaccess in /root .

A better solution would be to grant your user permission to create the project in the desired directory so you can run composer .

I am not sure if you moved composer.phar to the bin/composer folder or not, anyway try creating a Symfony folder in htdocs ; inside the folder create composer.json which contains this ; now run this command in in terminal while you are redirected into the Symfony folder

php composer.phar install 

If you have composer.phar in the same directory that command should work otherwise you need to use the full path of composer.phar in the top command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM