0

Could not open the file “/opt/lampp/apps/moodle/htdocs/config.php”.

I need to edit this file line 30.

  • What error message does it give you, and what editor are you using? – Charles Green Jan 23 '19 at 18:43
  • 2
    Possible duplicate of [How can I edit a .conf file owned by root?](https://askubuntu.com/questions/184878/how-can-i-edit-a-conf-file-owned-by-root) – karel Jan 23 '19 at 18:48
  • 1
    Make sure you use the answer provided by @karel rather than the accepted answer to the linked question: The command in the linked question has been removed from Ubuntu. – Charles Green Jan 23 '19 at 18:54

1 Answers1

0

If you are following the installation instructions from moodle.com you may have missed a small, but essemtial point. Their command line

cd /var/www/html/moodle sudo vim config.php

realloy should be broken into correct separate lines, as:

cd /var/www/html/moodle
sudo vim config.php

The sudo part of the second command will prompt you for your password, and grant you root privileges for the editing of the "config.php" file. This could have been done in a single line command with

cd /var/www/html/moodle && sudo vim config.php

Charles Green
  • 20,952
  • 21
  • 60
  • 92