writePermission issue with October CMS

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,

# 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?

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:

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:

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:

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

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.

➜  ~ 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.

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??

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

I solved it using this command

sudo chmod -R 777 .

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

1 Like

thanks for the help!

@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

// 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:

/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

➜  ~ 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 .

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

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. If using ubuntu 19.10 (eoan), do not run this:

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

instead run this:

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

After installing docker, run:

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.

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.

No problem :stuck_out_tongue:, we’re not born knowing :slight_smile:.

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:

~ 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)

On a second thought, it may not be installed.

Run this:

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 :stuck_out_tongue:).

1 Like

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

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

1 Like

In that case, run:

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

heres all the steps I took a few hours ago.

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. :+1: