dpba63888 2011-06-09 15:39
浏览 60
已采纳

如何将站点上传到文件夹可写为php的服务器

This problem occurred to me multiple times now, and it's time for me to do it the right way!

How can I upload a website to the server, where php has access to the folders for writing data.

Usually I use an FTP program, but I can't upload as root, so there are restriction problems all over the place...

How do you do stuff like this?

Thanks!

EDIT

I'm sorry, I accidentally added rails to the tags instead off php.

Probably I need to clarify my problem, since the answers didn't really help me out here:

I already have a server running apache, DirectAdmin and some other stuff like rails.

And the problem is when I upload a website like joomla or wordpress via FTP the restrictions always need to be set to 777/775 or these sites can't write to the folders..

So what I need to know is: How can I upload these sites (via FTP/SSH) as a user (root) that is the same as php, so that php can create files in all folders it needs to write to?

Hope I'm being more clear now, thanks for the help so far!

  • 写回答

2条回答 默认 最新

  • dtqpw68806 2011-08-01 08:32
    关注

    The solution

    1. Upload your site with FTP

    2. SSH to the server and go to the public_html folder

    3. chown -R [user_name]:[group_name] [folder_name]

    For me the right user was apache..

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改