3

I am trying to install the Symfony 2:

php -r "file_put_contents('symfony', file_get_contents('https://symfony.com/installer'));"

But I am getting this error:

Warning: file_put_contents(symfony): failed to open stream: Permission denied in Command line code on line 1

Please help me in resolving this. Thanks

eli-k
  • 10,898
  • 11
  • 40
  • 44
Deepak Bhatia
  • 45
  • 1
  • 6
  • 1
    Do you have proper permissions to create files and directories in location where you try to install symfony? Do you install it under windows or linux? What steps did you take ? – Grzegorz Krauze Nov 27 '16 at 11:34
  • 1
    Possible duplicate of [file\_put\_contents permission denied](http://stackoverflow.com/questions/4917811/file-put-contents-permission-denied) – Pieter van den Ham Nov 27 '16 at 15:36

2 Answers2

2

It 'appears' that you are installing on Windows, but regardless the command you are using is incorrect. See this reference:

https://symfony.com/doc/current/setup.html#creating-symfony-applications

So if on Windows try:

c:\> php -r "readfile('https://symfony.com/installer');" > symfony

Make sure you have permissions on the folder you are using.

Alvin Bunk
  • 7,621
  • 3
  • 29
  • 45
  • Hi there Deepak. Did my answer resolve your issue? If so, can you also click the checkmark besides my answer, this is so when people search they can see the correct answer. Thanks! – Alvin Bunk Nov 28 '16 at 19:01
0

I have this issues in - Drupal with composer command.

Straightforward - cool solution -

  • in Desktop GUI - right click - the particular parent folder, go down - and - you would find folder, which will have - "only reading permission"

Make this - as "Read and write" this will suffice the resolution.

Paul Bradbury
  • 482
  • 6
  • 8