Yii Framework Forum: How Can I Upload My File Into Ftp Server? - Yii Framework Forum

Jump to content

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

How Can I Upload My File Into Ftp Server? Rate Topic: -----

#1 User is offline   masud 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 11-December 12

Posted 11 December 2012 - 12:39 PM

Hi,
i am new in yii framework.i have completed my project in localhost.how can i upload my file in ftp server in public_html folder.Is there need any changes in the file.here is the code about my index.php file:

<?php

// change the following paths if necessary
$yii=dirname(__FILE__).'/../yii/framework.1.1.12/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

require_once($yii);
Yii::createWebApplication($config)->run();



Please help me.

THANKS
0

#2 User is offline   Cade 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 04-July 12

Posted 14 December 2012 - 09:04 PM

I would suggest going through the Yii help: http://www.yiiframework.com/doc/guide/

You would need to upload the index.php, protected directory and /yii/framework.1.1.12 directory.


A good added security measure is to store your protected directory outside your public_html directory.
Only the index.php, css, js and images are required to be in the public_html directory. You just need to change the line:
$config=dirname(__FILE__).'/protected/config/main.php';
to somethnig like
$config=dirname(__FILE__).'/../yii/protected/config/main.php';


If it is in production mode, then the comments in the index.php file should be reviewed and debugging commented out, this will prevent error messages showing up and will speed up your application.


In general when transferring through FTP, I would suggest zipping everything in 1 file, transfer it on, go in via SSH to unzip it and make sure your index.php, css, js and images have CHMOD 755 permissions to prevent issues.
Regards,
Cade

Current Projects
You Do It List: http://youdoitlist.com.au
0

#3 User is offline   Kollipara Rama Krishna 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 12-May 12

Posted 15 December 2012 - 01:55 AM

try to use this extension it may help you,i tried it works fine

http://www.yiiframew...m/extension/ftp
0

#4 User is offline   J.J 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 126
  • Joined: 01-April 11

Posted 15 December 2012 - 04:35 AM

View Postmasud, on 11 December 2012 - 12:39 PM, said:

Hi,
i am new in yii framework.i have completed my project in localhost.how can i upload my file in ftp server in public_html folder.Is there need any changes in the file.here is the code about my index.php file:

<?php

// change the following paths if necessary
$yii=dirname(__FILE__).'/../yii/framework.1.1.12/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

require_once($yii);
Yii::createWebApplication($config)->run();



Please help me.

THANKS


You can copy your framework into sub directory of your project. For examples:
- Your Project Directory
|--- yiiframework

And edit config/main.php like this:
$yii=dirname(__FILE__).'/yii/framework.1.1.12/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';


And don't forget to remove this line or change to false value for security reason:
defined('YII_DEBUG') or define('YII_DEBUG',false);

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