<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Install_on_OS_X</id>
	<title>Install on OS X - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Install_on_OS_X"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Install_on_OS_X&amp;action=history"/>
	<updated>2026-05-07T03:13:22Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Install_on_OS_X&amp;diff=9083&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Install_on_OS_X&amp;diff=9083&amp;oldid=prev"/>
		<updated>2024-10-18T06:54:56Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 06:54, 18 октября 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Олег Давидович</name></author>
	</entry>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Install_on_OS_X&amp;diff=9082&amp;oldid=prev</id>
		<title>1&gt;Frmbelz в 19:35, 16 января 2019</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Install_on_OS_X&amp;diff=9082&amp;oldid=prev"/>
		<updated>2019-01-16T19:35:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Yosemite and above native OSX install==&lt;br /&gt;
&lt;br /&gt;
This page is for people who want to do an OSX install without using someone else&amp;#039;s packaging. &lt;br /&gt;
There are some warning to bear in mind. &lt;br /&gt;
A native install of Moodle on an OSX machine is not really suitable as an internet linked live server  but it is great for testing and development. The OS X install described here is essentially the same as a Linux install and so the advice there can be applied here. Also Apple does not cooperate with your changes when upgrading the OS.&lt;br /&gt;
&lt;br /&gt;
Most of this work is via the cli which you can use in the ‘terminal’ application. To edit files, use nano or vi (vim). Mostly you need to be root to edit the files so precede your editor name by sudo. e.g sudo nano /etc/apache2/httpd.conf or sudo vi /etc/apache2/httpd.conf&lt;br /&gt;
&lt;br /&gt;
If you are doing any kind of development on an mac then consider an installation of  XCode (you can get this from the app store) which will install all sorts of odds and ends that you are likely to need now and then such as libraries for php etc.&lt;br /&gt;
&lt;br /&gt;
==Apache on Mac==&lt;br /&gt;
&lt;br /&gt;
Since Mac OS X Yosemite Apache and PHP come packaged with the OS so you only need to enable PHP and install MySQL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
sudo nano /etc/apache2/httpd.conf&lt;br /&gt;
or&lt;br /&gt;
sudo vim /etc/apache2/httpd.conf&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Starting Apache==&lt;br /&gt;
Since Apache is already installed you need to start it and to confirm it works. Start apache via command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
sudo apachectl start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want apache to start on boot then issue this command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test apache by going to http://localhost in a browser. If you see a message saying &amp;quot;&amp;#039;&amp;#039;&amp;#039;It Works!!&amp;#039;&amp;#039;&amp;#039;&amp;quot; , then apache is working correctly.&lt;br /&gt;
&lt;br /&gt;
In case of issues to verify that apache is running search for httpd process (with approximate output)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ ps aux | grep httpd | grep -v grep&lt;br /&gt;
_www             18859   0.0  0.0  4314808   1296   ??  S     9:38AM   0:00.00 /usr/sbin/httpd -D FOREGROUND&lt;br /&gt;
root             18858   0.0  0.1  4314808  11516   ??  Ss    9:38AM   0:00.35 /usr/sbin/httpd -D FOREGROUND&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check port 80 with netstat (with approximate output)&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ netstat -an | grep &amp;#039;.80&amp;#039; | grep -i LISTEN&lt;br /&gt;
tcp46      0      0  *.80                   *.*                    LISTEN&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other apache related commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ tail -10 /var/log/apache2/error_log&lt;br /&gt;
$ lsof -i:80&lt;br /&gt;
$ curl http://localhost:80/server-status&lt;br /&gt;
$ apachectl -S&lt;br /&gt;
$ which -a apachectl&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Making “Sites” work (Optional)=&lt;br /&gt;
&lt;br /&gt;
Mac users are used to having a /Sites folder which publishes a local-users web site  on http://&amp;lt;host url address&amp;gt;/~&amp;lt;UserName&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /etc/apache2/users&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
edit  &amp;lt;username&amp;gt;.conf&lt;br /&gt;
&lt;br /&gt;
with these contents. Don’t forget to change &amp;lt;username&amp;gt; for your username.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;Directory &amp;quot;/Users/&amp;lt;username&amp;gt;/Sites/&amp;quot;&amp;gt;&lt;br /&gt;
    AllowOverride All&lt;br /&gt;
    Options Indexes MultiViews FollowSymLinks&lt;br /&gt;
    Require all granted&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
==Apache configuration for /Sites folder==&lt;br /&gt;
If you want to set up /Sites folder, which is one of possible setups, and there is no /Sites folder on your mac, create one. Also create folders for moodle and moodledata inside /Sites folder.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ cd ~&lt;br /&gt;
$ mkdir Sites&lt;br /&gt;
$ cd Sites&lt;br /&gt;
$ mkdir moodle&lt;br /&gt;
$ mkdir moodledata&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Configure Apache to point to /Sites directory. Backup your httpd.conf, just in case, then open httpd.conf to make some changes&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ sudo cp /etc/apache2/httpd.conf /etc/apache2/httpd.conf.orig&lt;br /&gt;
$ sudo vim /etc/apache2/httpd.conf&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Change DocumentRoot to point to /Sites folder and uncomment httpd-vhosts.conf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
# DocumentRoot &amp;quot;/Library/WebServer/Documents&amp;quot;&lt;br /&gt;
DocumentRoot &amp;quot;/Users/mac_user_you_are_logged_in_with/Sites/&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
# Virtual hosts&lt;br /&gt;
Include /private/etc/apache2/extra/httpd-vhosts.conf&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Update httpd-vhosts.conf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ sudo vim /etc/apache2/extra/httpd-vhosts.conf&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Pick up a url you would use locally for moodle site, for example &amp;#039;mymoodle.dev.com&amp;#039;, and add to the bottom of the httpd-vhosts.conf file&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    DocumentRoot &amp;quot;/Users/mac_user_you_are_logged_in/Sites/moodle/&amp;quot;&lt;br /&gt;
    ServerName mymoodle.dev.com&lt;br /&gt;
    &amp;lt;Directory &amp;quot;/Users/mac_user_you_are_logged_in/Sites/moodle/&amp;quot;&amp;gt;&lt;br /&gt;
        Require all granted&lt;br /&gt;
    &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Update /etc/hosts&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
sudo vim /etc/hosts&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Add a url for a local moodle site, the same as in httpd-vhosts.conf, to the bottom of /etc/hosts&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
127.0.0.1   mymoodle.dev.com&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Restart Apache&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
sudo apachectl restart&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
After moodle set up you should be able to point a browser to &lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
http://mymoodle.dev.com/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Making php, etc. work=&lt;br /&gt;
&lt;br /&gt;
in /etc/apache2/httpd.conf uncomment all the following lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
LoadModule authz_core_module libexec/apache2/mod_authz_core.so&lt;br /&gt;
LoadModule authz_host_module libexec/apache2/mod_authz_host.so&lt;br /&gt;
LoadModule userdir_module libexec/apache2/mod_userdir.so&lt;br /&gt;
LoadModule php5_module libexec/apache2/libphp5.so&lt;br /&gt;
Include /private/etc/apache2/extra/httpd-userdir.conf&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since Moodle 3.3 minimum PHP version is 7.0.0 with PHP 7.1.x and 7.2.x also supported. If you have PHP 7 then php module would be&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;LoadModule php7_module libexec/apache2/libphp7.so&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart apache for the changes to take effect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
sudo apachectl restart&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Apache user permissions on /moodledata folder==&lt;br /&gt;
The default Apache user is &amp;quot;_www&amp;quot; and so your /moodledata folder needs write permissions for the _www user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
sudo chown &amp;lt;username&amp;gt;:_www moodledata&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the finder, choose the folder and using the get info dialogue to give _www write access to the folder.&lt;br /&gt;
&lt;br /&gt;
==Test php==&lt;br /&gt;
&lt;br /&gt;
Make a file in the root of your webfolder ( The default DocumentRoot for Mac OS X Yosemite is /Library/WebServer/Documents ) called phpinfo.php and add this content.&lt;br /&gt;
 &amp;lt;?php phpinfo(); ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, visit the site by url &lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
http://localhost/&amp;lt;your user name&amp;gt;/phpinfo.php&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This should give you the well known phpinfo page. The most likely error will be a page just showing the text &amp;lt;?php phpinfo(); ?&amp;gt; which means php is not working.&lt;br /&gt;
&lt;br /&gt;
==php modules==&lt;br /&gt;
To Do&lt;br /&gt;
{{update}}&lt;br /&gt;
&lt;br /&gt;
=Mysql=&lt;br /&gt;
&lt;br /&gt;
Download your version of Mysql from the Mysql site http://dev.mysql.com/downloads/mysql/ and install it! &lt;br /&gt;
The dmg install will allow you to start or stop the MySql server from your system preferences. If you tick the option to start on boot then it may not actually start on boot. This is an on-off issue with OSX.&lt;br /&gt;
&lt;br /&gt;
If you are not running OSX Server then you will probably need to install Mysql again if Apple issues an upgrade of Yosemite.&lt;br /&gt;
&lt;br /&gt;
dmg installed MySQL is in&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ ls /usr/local/mysql/&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After MySQL dmg installation if there is an issue with the MySQL PATH when mysql commands are run, add PATH to .bash_profile (if you are using bash)&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ mysql --version&lt;br /&gt;
-bash: mysql: command not found&lt;br /&gt;
$&lt;br /&gt;
$ vim ~/.bash_profile&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add path to mysql at the end of .bash_profile file you opened to edit&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
export PATH=&amp;quot;${PATH}:/usr/local/mysql/bin&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload .bash_profile&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ . ~/.bash_profile&lt;br /&gt;
$ mysql --version&lt;br /&gt;
mysql  Ver 8.0.13 for macos10.14 on x86_64 (MySQL Community Server - GPL)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start/stop/restart mysql&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
sudo /usr/local/mysql/support-files/mysql.server start&lt;br /&gt;
sudo /usr/local/mysql/support-files/mysql.server stop&lt;br /&gt;
sudo /usr/local/mysql/support-files/mysql.server restart&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connect to MySQL command line&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ mysql -u root -p&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create moodle MySQL user, database and grant privileges&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
mysql&amp;gt; CREATE USER &amp;#039;moodle&amp;#039;@&amp;#039;localhost&amp;#039; IDENTIFIED BY &amp;#039;moodle&amp;#039;;&lt;br /&gt;
Query OK, 0 rows affected (0.03 sec)&lt;br /&gt;
mysql&amp;gt; SELECT User, Host FROM mysql.user;&lt;br /&gt;
mysql&amp;gt; CREATE DATABASE moodle;&lt;br /&gt;
Query OK, 1 row affected (0.07 sec)&lt;br /&gt;
mysql&amp;gt; GRANT ALL PRIVILEGES ON moodle.* to &amp;#039;moodle&amp;#039;@&amp;#039;localhost&amp;#039;;&lt;br /&gt;
Query OK, 0 rows affected (0.06 sec)&lt;br /&gt;
mysql&amp;gt; FLUSH PRIVILEGES;&lt;br /&gt;
mysql&amp;gt; SHOW GRANTS;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Using Homebrew=&lt;br /&gt;
&lt;br /&gt;
This is an easier alternative to installation of required packages. Homebrew is a package management tool like apt and yum which was created for OSX. Everything ends up in /usr/local or similar and when Apple does an upgrade, they shouldn&amp;#039;t muck it up.&lt;br /&gt;
The homebrew site is at http://brew.sh &lt;br /&gt;
&lt;br /&gt;
Start with the command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
$ /usr/bin/ruby -e &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Homebrew will download and install Command Line Tools for Xcode as part of the installation process.&lt;br /&gt;
&lt;br /&gt;
Packages installed with Homebrew are in&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ ls /usr/local/Cellar&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Moodle with PostgreSQL=&lt;br /&gt;
PostgreSQL is one of the five databases supported by Moodle. You can use Homebrew to install PostgreSQL on OSX&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ brew install postgresql&lt;br /&gt;
$ ls /usr/local/Cellar/postgresql/&lt;br /&gt;
$ brew info postgres&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start/stop PostgreSQL manually&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ pg_ctl -D /usr/local/var/postgres start&lt;br /&gt;
$ pg_ctl -D /usr/local/var/postgres stop&lt;br /&gt;
$ pg_ctl -D /usr/local/var/postgres status&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start/stop PostgreSQL using brew&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ brew services start postgresql&lt;br /&gt;
$ brew services stop postgresql&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there is an error on brew start/stop try running&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ brew services start postgresql&lt;br /&gt;
Error: Service `postgresql` is not started.&lt;br /&gt;
&lt;br /&gt;
$ brew tap gapple/services&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a new database cluster (collection of databases), postgres user, start postgresql. By default user postgres will not have any login password.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ initdb /usr/local/var/postgres/data&lt;br /&gt;
$ ls /usr/local/Cellar/postgresql/&lt;br /&gt;
$ /usr/local/opt/postgres/bin/createuser -s postgres&lt;br /&gt;
$ pg_ctl -D /usr/local/var/postgres start&lt;br /&gt;
$ psql -U postgres&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a moodle user, database&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
postgres=# CREATE USER moodleuser WITH PASSWORD &amp;#039;your_password&amp;#039;;&lt;br /&gt;
CREATE ROLE&lt;br /&gt;
postgres=# CREATE DATABASE moodle WITH OWNER moodleuser;&lt;br /&gt;
CREATE DATABASE&lt;br /&gt;
postgres=# \l&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PostgreSQL uses a client authentication file called &amp;#039;pg_hba.conf&amp;#039; in PostgreSQL&amp;#039;s &amp;#039;data&amp;#039; folder. In this file, you&amp;#039;ll find a list of which users are allowed to connect to which databases, the IP addresses they are allowed to connect from, and the authentication methods they can use to connect.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ vim /usr/local/var/postgres/data/pg_hba.conf&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
To grant permission for Moodle to connect to a PostgreSQL server on the same machine, add the following line, changing the DATABASE and USER columns to your actual database name and the username you set up above. The METHOD field should say &amp;quot;password&amp;quot; - don&amp;#039;t put your actual password here.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 # TYPE      DATABASE    USER            CIDR-ADDRESS        METHOD&lt;br /&gt;
   host        moodle      moodleuser      127.0.0.1/32        password&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Installing Moodle using cli=&lt;br /&gt;
&lt;br /&gt;
Download Moodle .tgz file of the version needed, for example https://download.moodle.org/download.php/stable36/moodle-latest-36.tgz, move it into /Sites folder&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ mv ~/Downloads/moodle-latest-36.tgz ~/Sites/&lt;br /&gt;
$ tar -zxvf moodle-latest-36.tgz moodle&lt;br /&gt;
$ cd moodle&lt;br /&gt;
Create moodle&amp;#039;s config.php using install script&lt;br /&gt;
$ /usr/bin/php admin/cli/install.php&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Point browser to url you have set up locally, for example, http://mymoodle.dev.com/. If there are errors in the browser&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Warning: require_once(/Users/vpp/Sites/moodle/moodle/config.php): failed to open stream: Permission denied in /Users/vpp/Sites/moodle/moodle/index.php on line 30&lt;br /&gt;
&lt;br /&gt;
Fatal error: require_once(): Failed opening required &amp;#039;config.php&amp;#039; (include_path=&amp;#039;.:&amp;#039;) in /Users/vpp/Sites/moodle/moodle/index.php on line 30&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
you might need to change the owner on just generated config.php file&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ sudo chown your_user:_www config.php&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Install database. Use Moodle admin password you have set up when running admin/cli/install.php script above. &lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ sudo -u _www /usr/local/bin/php admin/cli/install_database.php --lang=en --adminpass=whatever_moodle_admin_pass_you_setup --agree-license&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
If you are using PHP path /usr/bin/php when running above scripts and there is an error about PHP Intl extension php_intl try using /usr/local/bin/php which might be PHP installed with brew. To see what PHP you are using run&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
$ which php&lt;br /&gt;
/usr/local/bin/php&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>1&gt;Frmbelz</name></author>
	</entry>
</feed>