Yii Framework Forum: Failed to open stream: Permission denied. First time user, can't get first project working. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Failed to open stream: Permission denied. First time user, can't get first project working. Rate Topic: -----

#1 User is offline   TheChosenOne570 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 21-October 11

Posted 21 October 2011 - 11:34 PM

I'm running Fedora 14, Apache 2.2.17, PHP5. Here's the exact output:

Warning: require_once(/var/www/html/Yii/framework/yii.php): failed to open stream: Permission denied in /var/www/html/Yii/testdrive/index.php on line 12 Fatal error: require_once(): Failed opening required '/var/www/html/Yii/testdrive/../framework/yii.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/Yii/testdrive/index.php on line 12
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,359
  • Joined: 12-October 09
  • Location:Croatia

Posted 22 October 2011 - 02:04 AM

Hi and welcome to the Yii forum

As the error say... you have a permission problem... so check your permissions
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   TheChosenOne570 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 21-October 11

Posted 22 October 2011 - 12:47 PM

View Postmdomba, on 22 October 2011 - 02:04 AM, said:

Hi and welcome to the Yii forum

As the error say... you have a permission problem... so check your permissions


Thanks. I figured that much out. /var/www/html/Yii/testdrive/index.php, /var/www/html/Yii/framework/yii.php, and /usr/share/php all have permissions -rwxr-xr-x. I don't see where the problem could be.
0

#4 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 22 October 2011 - 01:41 PM

View PostTheChosenOne570, on 22 October 2011 - 12:47 PM, said:

Thanks. I figured that much out. /var/www/html/Yii/testdrive/index.php, /var/www/html/Yii/framework/yii.php, and /usr/share/php all have permissions -rwxr-xr-x. I don't see where the problem could be.


Directory permission?

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

#5 User is offline   TheChosenOne570 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 21-October 11

Posted 22 October 2011 - 03:05 PM

View Posttri, on 22 October 2011 - 01:41 PM, said:

Directory permission?

/Tommy


/var/www/html/Yii = drwxr-xr-x

All Yii subdirectories have the same permissions. Should I be looking somewhere else? Another directory? Could it be a misleading error?
0

#6 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 22 October 2011 - 03:45 PM

This is probably a misleading error.
Where is your newly created app?
Where is Yii?
It would help if you threw in a bit more info. :)
"Less noise - more signal"
0

#7 User is offline   Håkan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 23-October 11

Posted 23 October 2011 - 01:02 PM

Hi, i'am a new bee and have same problem when i try to get the first project to run. And i am administrotor on my win 7 machin and never have any problem with access before. Can anyone help to solve my problem, please!:

generate protected/yiic.bat
PHP Error[2]: file_put_contents(C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\testdrive\protected\yiic.bat): failed to open stream: Per
mission denied
in file C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\framework\console\CConsoleCommand.php at line 355
#0 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\framework\console\CConsoleCommand.php(355): file_put_contents()
#1 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\framework\cli\commands\WebAppCommand.php(70): WebAppCommand->copyFiles()
#2 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\framework\console\CConsoleCommandRunner.php(63): WebAppCommand->run()
#3 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\framework\console\CConsoleApplication.php(88): CConsoleCommandRunner->run()
#4 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\framework\base\CApplication.php(158): CConsoleApplication->processRequest()
#5 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\framework\yiic.php(33): CConsoleApplication->run()
#6 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\framework\yiic(15): require_once()

C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\framework>
0

#8 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 23 October 2011 - 02:33 PM

View PostHåkan, on 23 October 2011 - 01:02 PM, said:

generate protected/yiic.bat
PHP Error[2]: file_put_contents(C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\testdrive\protected\yiic.bat): failed to open stream: Per
mission denied


Welcome to the forum!

Check if this copy operation will work
C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\framework>
copy cli\views\webapp\protected\yiic.bat ..\testdrive\protected

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

#9 User is offline   TheChosenOne570 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 21-October 11

Posted 24 October 2011 - 02:24 AM

At first, I thought it was a permissions problem. After changing permissions and getting nowhere, I found the solution in a cakePHP forum... I adjusted it for Yii:

chcon -Rv --type=httpd_user_content_rw_t /var/www/html/yii/
0

#10 User is offline   Håkan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 23-October 11

Posted 24 October 2011 - 02:39 AM

View Posttri, on 23 October 2011 - 02:33 PM, said:

Welcome to the forum!

Check if this copy operation will work
C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\yii\framework>
copy cli\views\webapp\protected\yiic.bat ..\testdrive\protected

/Tommy


No, sorry, not working.
Access denied (Åtkomst nekad)
/Håkan
0

#11 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 24 October 2011 - 06:07 AM

View PostHåkan, on 24 October 2011 - 02:39 AM, said:

No, sorry, not working.
Access denied (Åtkomst nekad)
/Håkan


This confirms it's not a Yii problem. Check that you have read permission for the source file and write permission for the destination directory. Possibly also permission to delete an already existing file.

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

#12 User is offline   wickedsmith 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 25-March 13

Posted 25 March 2013 - 04:32 PM

Hi I am a new to yii,

and created a new project (testdrive) on windows7 under xampp.
First there were Problems to get yiic.php running.
After getting the right Path into the Path variable i got yiic running.
In the console you have to write the following:
php C:\xampp\yii\framework\yiic.php webapp ..\yii\testdrive

I copied the Project to the demofolder, opened the Browser
with:

localhost/yii/demos/testdrive/index.php

Here I got the following error:
require_once(C:\xampp\htdocs\yii\demos\teestdrive/../../test/yii.php): failed to open stream: No such file or directory in C:\xampp\htdocs\yii\demos\testdrive\index.php on line 12

to get the thing started i had to open the index.php in a editor
and change the following line:
$yii=dirname(__FILE__).'/../yii.php';
To
$yii=dirname(__FILE__).'/../../framework/yii.php';

Now it works !!!

when creating the new Project via yiic the path wasnt the right one ?

You have to change it manually. It is hard work to get this thing started
and the creators of yii have to think about that. A newbie will throw the whole thing away
and will test zend Framework ;-)

Maybe this will help someone

wickedsmith
0

#13 User is offline   rajesh chaurasia 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 12-January 13
  • Location:Mohali

Posted 17 April 2013 - 07:06 AM

hi you can change the permission of your folder to write and execute to access for that.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users