简体   繁体   English

在Ubuntu 14.04 x64 DigitalOcean上安装带主题的特定Wordpress安装

[英]Install specific Wordpress installation with theme on Ubuntu 14.04 x64 DigitalOcean

Our company's partners sent us custom Wordpress installation for website. 我们公司的合作伙伴向我们发送了针对网站的自定义Wordpress安装。

Installation contains 2 files: 安装包含2个文件:

  1. installer.php installer.php

  2. installation.zip (example) installation.zip(示例)

I followed this guide to install Apache, MySQL, PHP (LAMP) stack on Ubuntu 14.04 . 我按照指南Apache, MySQL, PHP (LAMP) stack on Ubuntu 14.04安装Apache, MySQL, PHP (LAMP) stack on Ubuntu 14.04 Worked perfectly. 工作得很完美。

Then followed this guide to install Wordpress, but instead of downloading install from Wordpress website I used my custom installation. 然后按照指南安装Wordpress,但我没有从Wordpress网站下载安装,而是使用了自定义安装。

Now those both files remain in /var/www/html 现在这两个文件都保留在/var/www/html

Then I accessed: http://my_server_ip/installer.php 然后我访问了: http://my_server_ip/installer.php

And got this Error: 并得到此错误:

在此输入图像描述

What I tried is: 我尝试的是:

  1. Restarted Apache with sudo service apache2 restart 使用sudo service apache2 restart启动Apache

  2. Set both file permisions to 777, now I got -rwxrwxrwx 1 root edgars 424438 Jan 20 07:52 installer.php 将文件-rwxrwxrwx 1 root edgars 424438 Jan 20 07:52 installer.php设置为777,现在我得到-rwxrwxrwx 1 root edgars 424438 Jan 20 07:52 installer.php

  3. Changed file owner to edgars now it looks like this: 将文件所有者更改为edgars现在看起来像这样:

      -rwxrwxrwx 1 edgars 30208410 Jan 20 07:58 201412166115237_archive.zip -rwxrwxrwx 1 edgars 424438 Jan 20 07:52 installer.php 

Restarted again Apache, but still can't pass that test.. 重新启动Apache,但仍然无法通过该测试..

Any help would be great. 任何帮助都会很棒。

Thanks. 谢谢。

This tells you that PHP can't write into /var/www/html, so you have to change permissions in that directory. 这告诉您PHP无法写入/ var / www / html,因此您必须更改该目录中的权限。 It looks like you're only changing the file permissions and not the directory. 看起来您只是更改文件权限而不是目录。

Also, don't use 777, 755 should be enough. 另外,不要使用777,755应该就够了。 Or better yet, just set the directory ownership to whatever apache's username is (usually www-data). 或者更好的是,只需将目录所有权设置为apache的用户名(通常是www-data)。

Commands: 命令:

# change permissions of directory
chmod -R 755 /var/www/html 
# change ownership of directory
chown -R www-data:www-data /var/www/html

www-data may or may not be the user apache's using for its processes; www-data可能是也可能不是用户apache用于其进程的数据; you can check for the actual username using: 您可以使用以下方法检查实际用户名:

ps aux | egrep '(apache|httpd)'

You can try 你可以试试

sudo chown root:www-data -R /var/www/html

It gives permissions to group root & user www-data. 它为组root和用户www-data提供权限。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM