# writePermission issue with October CMS

**URL:** <https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232>\
**Category:** General\
**Created:** [February 7, 2020, 1:14pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232 "2020-02-07T13:14:50Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 7, 2020, 1:14pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/1 "2020-02-07T13:14:50Z")

</div>

I am currently tryin to install OctoberCMS on my ubuntu 18.04 machine.

Here are the steps I took and the issue I run into,

```auto
# October CMS

## Installation

* Steps I took
  1. downloaed install-master from official site
  2. installed XAMPP 
  3. created a folder called `buddhistblog` inside this directory `/opt/lampp/htdocs`
  4. Copied isntall_files + install.php from the folder to `/opt/lampp/htdocs/buddhistblog`
  5. went to localhost/buddhistblog/install.php then got hit by the `writePermission` error
  6. 
  

* Issue: Permission to write to directories and files

* Tried Solution : 

/*does not work, cannot find directory*/
chown -R www-data:www-data /var/www/html/octobercms
chmod -R 755 /var/www/html/octobercms

/*does not work cannot access 'public_html': No such file or directory
*/
chmod -R ugo+rw public_html

/*does not work cannot access 'public_html': No such file or directory
*/
sudo chmod -R ugo+rw /opt/lampp/htdocs/october/html

```

I understand that you need to give october CMS the writting permission to system. But I couldnt find where the CMS is being installed .

Does anyone know how to fix this?

---

<div class="post-metadata">

**Author:** ![skaparate](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skaparate/32/125896_2.png) [@skaparate](https://forum.freecodecamp.org/u/skaparate)\
**Post date:** [February 7, 2020, 3:16pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/2 "2020-02-07T15:16:13Z")

</div>

Hello!

I believe, based on the routes you say you copied the files, the commands to change the permissions are wrong.

If the blog (CMS) is installed to `/opt/lampp/htdocs/buddhistblog`, then that’s the path you should use:

```auto
chown -R www-data:www-data /opt/lampp/htdocs/buddhistblog
chmod -R 755 /opt/lampp/htdocs/buddhistblog

```

Note, however, that the `user:group` (_for the first command_), should be the same as the one on `/opt/lampp/htdocs`:

```bash
stat -c "%U:%G" /opt/lampp/htdocs
# Sample output
# root:root

```

So, if the user and group of `/opt/lamp/htdocs` is `root:root`, then the command would be:

```auto
chown -R root:root /opt/lampp/htdocs/buddhistblog

```

---

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 7, 2020, 4:04pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/3 "2020-02-07T16:04:57Z")

</div>

first of all, thanks for the reply,

and I tried all 3 commands … lol

and restarted the XAMPP server.

Still the permissions arent given to OctoberCMS.

```auto
➜ ~ sudo chown -R root:root /opt/lampp/htdocs/buddhistblog

[sudo] password for zhouxiang: 
➜ ~ sudo chmod -R 755 /opt/lampp/htdocs/buddhistblog

➜ ~ sudo /opt/lampp/lampp stop

Stopping XAMPP for Linux 7.4.1-1...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...ok.
➜ ~ sudo /opt/lampp/lampp start

Starting XAMPP for Linux 7.4.1-1...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
➜ ~ sudo chown -R www-data:www-data /opt/lampp/htdocs/buddhistblog

➜ ~ 

```

all of those commands worked… I got a little green arrow on my ohmyzsh theme, which indicates it should worked.

---

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 7, 2020, 4:12pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/4 "2020-02-07T16:12:29Z")

</div>

if this helps: on their documentation page I saw this note:

> **Note:** A detailed installation log can be found in the `install_files/install.log` file.

However when I open the said directory, there isn’t a install.log file in it… does it mean that I didn’t even install the CMS on my system??

---

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 7, 2020, 4:19pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/5 "2020-02-07T16:19:12Z")

</div>

the whole installation process I followed this tutorial : (you just need to watch until the 6 mins mark)

---

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 7, 2020, 4:25pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/6 "2020-02-07T16:25:03Z")

</div>

I solved it using this command

```auto
sudo chmod -R 777 .

```

Here is the site :[https://october-plaza.com/blog/how-install-october-cms-wizard](https://october-plaza.com/blog/how-install-october-cms-wizard)

---

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 7, 2020, 4:25pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/7 "2020-02-07T16:25:13Z")

</div>

thanks for the help!

---

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 7, 2020, 7:59pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/8 "2020-02-07T19:59:43Z")

</div>

@skaparate I’m back… here is another issue I run into.

I was trying to setup mySQL server using octoberCMS 's instruction, but somehow it returns me this error :

> **SQLSTATE[HY000] [1045] Access denied for user ‘root’@‘localhost’ (using password: YES)**

so I started doing these steps until I run into another error

```auto
// 1. stop mySQL
sudo /etc/init.d/mysql stop

// 2. Start MySQL in safe mode
sudo mysqld_safe --skip-grant-tables &

// the result I get: 

[1] 7770
➜ ~ 2020-02-07T19:42:08.681349Z mysqld_safe Logging to syslog.
2020-02-07T19:42:08.686942Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2020-02-07T19:42:08.698297Z mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.

[1] + 7770 exit 1 sudo mysqld_safe --skip-grant-tables

// 3. Log into MySQL using root
mysql -uroot

// ERROR I GET
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

```

the issue description on stackoverflow is this :

> I once had this problem and solved it by installing `mysql-server`, so make sure that you have installed the `mysql-server`, not the `mysql-client` or something else.

> That error means the file `/var/run/mysqld/mysqld.sock` doesn’t exists, if you didn’t install `mysql-server`, then the file would not exist. But if the `mysql-server` is already installed and is running, then you need to check the config files.

> The config files are:

```sql
/etc/my.cnf
/etc/mysql/my.cnf
/var/lib/mysql/my.cnf

```

> In `/etc/my.cnf`, the socket file config may be `/tmp/mysql.sock` and in `/etc/mysql/my.cnf` the socket file config may be `/var/run/mysqld/mysqld.sock`. So, remove or rename `/etc/mysql/my.cnf`, let mysql use `/etc/my.cnf`, then the problem may solved.

**my own issue right now is : I cannot find var/run/mysqld folder. the folder does not exist, but I do have mysql-server installed, I checked it using this command and it returns me this error**

```auto
➜ ~ sudo systemctl status mysql

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2020-02-08 03:41:23 CST; 5min ago
  Process: 7398 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS)
  Process: 7389 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 7400 (code=exited, status=0/SUCCESS)

Feb 08 03:40:06 zhouxiang-ThinkPad-E495 systemd[1]: Starting MySQL Community Server...
Feb 08 03:40:06 zhouxiang-ThinkPad-E495 systemd[1]: Started MySQL Community Server.
Feb 08 03:41:21 zhouxiang-ThinkPad-E495 systemd[1]: Stopping MySQL Community Server...
Feb 08 03:41:23 zhouxiang-ThinkPad-E495 systemd[1]: Stopped MySQL Community Server.

```

so I don’t know what to do right now .

---

<div class="post-metadata">

**Author:** ![skaparate](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skaparate/32/125896_2.png) [@skaparate](https://forum.freecodecamp.org/u/skaparate)\
**Post date:** [February 7, 2020, 9:23pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/9 "2020-02-07T21:23:50Z")

</div>

You could create the folder yourself and give it the right permissions:

```auto
sudo mkdir -p /var/run/mysqld
sudo chown -R mysql:mysql /var/run/mysqld
# Start MySQL
sudo sytemctl start mysql

```

Try that and see if it works. Otherwise your installation could be corrupt.

Another alternative, which will help you always, is to [use docker](https://docs.docker.com/install/linux/docker-ce/ubuntu/). **If using ubuntu 19.10 (eoan)**, do not run this:

````auto
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"```

````

instead run this:

```auto
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu disco stable"

```

After installing docker, run:

```auto
docker run --name my-app -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:latest

```

Then you can connect to it on `localhost:3306`.

---

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 20, 2020, 7:30pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/10 "2020-02-20T19:30:23Z")

</div>

sorry for the late reply… I just got some free time where I can work on this.

Could these errors mean that I don’t have **mySQL server + client** installed on my machine?? Cos I dont remember installing them… Sorry if being noob LOL.

---

<div class="post-metadata">

**Author:** ![skaparate](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skaparate/32/125896_2.png) [@skaparate](https://forum.freecodecamp.org/u/skaparate)\
**Post date:** [February 20, 2020, 8:53pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/11 "2020-02-20T20:53:30Z")

</div>

> [@zhouxiang19910319](#):
>
> Sorry if being noob LOL

No problem 😛, we’re not born knowing 🙂.

> [@zhouxiang19910319](#):
>
> Could these errors mean that I don’t have **mySQL server + client** installed on my machine?

Well, yes, that would be a problem… however, I would say that’s not the case because your log says that you have it installed:

```auto
~ sudo systemctl status mysql

mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sat 2020-02-08 03:41:23 CST; 5min ago
  Process: 7398 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS)
  Process: 7389 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 7400 (code=exited, status=0/SUCCESS)

```

---

<div class="post-metadata">

**Author:** ![skaparate](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skaparate/32/125896_2.png) [@skaparate](https://forum.freecodecamp.org/u/skaparate)\
**Post date:** [February 20, 2020, 9:01pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/12 "2020-02-20T21:01:44Z")

</div>

On a second thought, it may not be installed.

Run this:

```auto
dpkg --get-selections | grep mysql

```

It should list the mysql package if it’s installed, otherwise it should be empty (or it may say _not installed_, I don’t remember 😛).

---

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 20, 2020, 9:29pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/13 "2020-02-20T21:29:07Z")

</div>

> [@skaparate](#):
>
> dpkg --get-selections | grep mysql

it returns empty. I am gonna find another way to work this around.

---

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 20, 2020, 9:55pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/14 "2020-02-20T21:55:56Z")

</div>

for the light of herats enjoy this meme I just made which perfectly describes how I feel right now.

 ![fuck](https://global.discourse-cdn.com/freecodecamp/original/3X/7/6/76556bfdb1dee1d25074e73ed6b1ec8ea9ea18d7.jpeg)

---

<div class="post-metadata">

**Author:** ![skaparate](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/skaparate/32/125896_2.png) [@skaparate](https://forum.freecodecamp.org/u/skaparate)\
**Post date:** [February 20, 2020, 11:32pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/15 "2020-02-20T23:32:13Z")

</div>

In that case, run:

```bash
# remove mysql first, just in case
> sudo apt remove mysql-server mysql-client
# then, install it
> sudo apt install mysql-server mysql-client

```

---

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 20, 2020, 11:40pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/16 "2020-02-20T23:40:43Z")

</div>

> [@mySQL server refused to be installed on Ubuntu 18.04](http://forum.freecodecamp.org/t/mysql-server-refused-to-be-installed-on-ubuntu-18-04/351969):
>
> Guys sorry for the harsh tone I am just simply want to solve this issue asap. steps I took: sudo apt-get update sudo apt-get install mysql-server errors I got : Setting up mysql-server-5.7 (5.7.29-0ubuntu0.18.04.1) ... update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode Renaming removed key\_buffer and myisam-recover options (if present) dpkg: error processing package mysql-server-5.7 (--configure): installed mysql-server-5.7 package post-instal…

heres all the steps I took a few hours ago.

---

<div class="post-metadata">

**Author:** ![zhouxiang19910319](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/zhouxiang19910319/32/98849_2.png) [@zhouxiang19910319](https://forum.freecodecamp.org/u/zhouxiang19910319)\
**Post date:** [February 21, 2020, 12:48am UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/17 "2020-02-21T00:48:18Z")

</div>

tomorrow I will delete both mySQL and XAMPP from my machine altogether and do a reinstall. 1st, mySQL-server + mySQL-client, second XAMPP.

I will post the result here. Thanks for the helps. 👍

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 7:35pm UTC](https://forum.freecodecamp.org/t/writepermission-issue-with-october-cms/348232/18 "2021-06-01T19:35:18Z")

</div>

Closed on June 1, 2021, 7:35pm UTC


