Yii Framework Forum: php safe mode - Yii Framework Forum

Jump to content

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

php safe mode Rate Topic: -----

#1 User is offline   Timdejager 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 29-December 08

Posted 29 December 2008 - 04:10 PM

Hi,

Is it possible to use the yii framework in a php safe mode restricted environment? I tried deploying a bare bones project on the server but i got this error:

copy() [<a href='function.copy'>function.copy</a>]: SAFE MODE Restriction in effect. The script whose uid is 10169 is not allowed to access httpdocs/b4u/assets/87675fa2 owned by uid 48.

#0 httpdocs/b4u/framework/utils/CFileHelper.php(108): copy()
#1 httpdocs/b4u/framework/utils/CFileHelper.php(110): copyDirectoryRecursive()
#2 httpdocs/b4u/framework/utils/CFileHelper.php(46): copyDirectoryRecursive()
#3 httpdocs/b4u/framework/web/CAssetManager.php(157): copyDirectory()
#4 httpdocs/b4u/framework/web/CClientScript.php(192): publish()
#5 httpdocs/b4u/framework/web/CClientScript.php(225): getCoreScriptUrl()
#6 httpdocs/b4u/framework/web/CClientScript.php(108): renderCoreScript()
#7 httpdocs/b4u/framework/web/CClientScript.php(84): renderHead()
#8 httpdocs/b4u/framework/web/CController.php(236): render()
#9 httpdocs/b4u/framework/web/CController.php(429): processOutput()
#10 httpdocs/b4u/protected/controllers/SiteController.php(45): render()
#11 httpdocs/b4u/framework/web/actions/CInlineAction.php(32): actionLogin()
#12 httpdocs/b4u/framework/web/CController.php(218): run()
#13 httpdocs/b4u/framework/web/CController.php(203): runAction()
#14 httpdocs/b4u/framework/web/CController.php(178): runActionWithFilters()
#15 httpdocs/b4u/framework/web/CWebApplication.php(149): run()
#16 httpdocs/b4u/framework/web/CWebApplication.php(121): runController()
#17 httpdocs/b4u/framework/base/CApplication.php(146): processRequest()
#18 httpdocs/b4u/index.php(11): run()

Does anyone have anymore information about this situation?

Thanks,

Tim
0

#2 User is offline   Bethrezen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 76
  • Joined: 24-December 08
  • Location:Tambov, Russia

Posted 06 January 2009 - 09:39 AM

i've also met this problem
0

#3 User is offline   dyrathror 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-October 08

Posted 06 January 2009 - 11:02 AM

I can only advise you to ask your provider to switch the SAFE_MODE off.
It will not be included in future PHP versions anyway.

D.

0

#4 User is offline   Bethrezen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 76
  • Joined: 24-December 08
  • Location:Tambov, Russia

Posted 06 January 2009 - 11:09 AM

It's not a good idea. Hoster will not do this.
0

#5 User is offline   Ascomae 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 01-January 09
  • Location:Germany

Posted 06 January 2009 - 02:11 PM

Those script are owned by different User (uid)

Can you change the ownership of these files?


Christian
0

#6 User is offline   Bethrezen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 76
  • Joined: 24-December 08
  • Location:Tambov, Russia

Posted 06 January 2009 - 02:21 PM

In this case it might be piece a cake. But I can't. I only have FTP access to httpdocs directory. No ssh at all. chmod 0777 to assets/* doesn't help.
For example blog demo application should create jquery.js there. But it does n't.
0

#7 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,874
  • Joined: 04-October 08
  • Location:DC, USA

Posted 06 January 2009 - 02:44 PM

In this environment, how would you use a script to create a subdirectory and upload files into it?
0

#8 User is offline   Ascomae 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 01-January 09
  • Location:Germany

Posted 06 January 2009 - 02:47 PM

Would it be a solution for you, to start the Yii-Application locally and create the assets/* Files on a local system.

You can put these files to the FTP-Server. Then you would be the owner.


Christian

PS:
I Don't know, when and how Yii creates the JS-files in assets/*
0

#9 User is offline   hungxalo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 08-March 10

Posted 12 November 2012 - 11:51 PM

I already met that problem too!
Thanks for your advice.
0

#10 User is offline   Barnabas Tso 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 10-April 13

Posted 16 June 2013 - 10:06 PM

To solve problem. Transfer your locally created assets folder with it's contents to server using ftp. This will ensure hosted assets folder and it's contents have appropriate owner/group id.
With everything else setup correctly look at assets error message displayed on screen. Using error example above.
Open your hosted assets folder on server, you should see two sets of folders distinguishable by uid. Open the folders with uid not 48 and search for one containing the right js files.
When files found, rename that folder to 87675fa2 based on our example. Then grant the folder and subfolders 777 permissions.
This should now work. Just repeat the process for the other assets related errors. The same solution should be applied if you get a mkdir() problem too related to assets.
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