Manual install on Windows 7 with Apache and MySQL

These are instructions for installing on Windows 7 desktop (they may also be useful for a server install with some thought to security) using individual components rather than a one click installer. This is intended only as a testing/evaluation install via ‘localhost‘. Proper server configuration and security is not considered.

NOTE: This assumes that you are comfortable with administering a Windows system and can use the command line. I never use Windows and I managed, but this may not be the quickest or most efficient way to do things. Make sure your Windows installation is in good shape, you clear out all the junk and stuff making it run slower (because installing all this server software certainly isn‘t going to make it run faster!) and that you have installed any outstanding updates.

ANOTHER NOTE: Watch out for the irritating "Do you want this program to get control of your computer" window that comes up at various stages. Sometimes it didn‘t appear but you do see a shield dimly flashing in the task bar. Click and say yes.

CONTENTS

[hide]

Step 1: Install MySQL

  • Install the MySQL database server on your PC. We will do this using the ‘MSI‘ one-click installer for Windows. Go to http://dev.mysql.com/downloads/ and download the ‘MySQL Installer for Windows‘. At the time of writing this was from a very obvious graphic at the top of the screen (which I missed the first time).
  • Run the installation. Click...
    • Install MySQL products
    • Accept the license
    • Allow the version check (optional)
    • At ‘Choose a Setup Type‘ accept the "Developer Default" and click Next
    • A number of downloads of required software may be identified. Click Execute and follow onscreen instructions to install them.
    • At ‘Installation progress‘ screen, hit Execute - the MySQL software will be installed
    • At ‘Configuration overview‘ hit Next to go to the basic configuration screen.
    • Accept all the defaults on the ‘MySQL Server Configuration‘ and hit Next.
    • On the password screen, supply a password for the ‘root‘ (main administrator) user. Make sure it‘s one you won‘t forget. You can also create a ‘User‘ account just for Moodle with more restricted access if you like. This would be good practice on a public server but just using the ‘root‘ user will suffice for testing.
    • On the Service details page, accept the defaults and hit Next and then Next a couple more times for the configuration progress.
    • Click Finish. Job done.
  • MySQL Workbench will open. Under Server Administration (right hand column, double click ‘Local MySQL56‘ (or whatever you called it). A box should pop up asking for the root password. Enter the password you supplied
  • The server management screen should appear. You don‘t have to worry too much about this. It just shows the install is working.

Step 2: Install Apache

  • Install the Apache web server on your PC. Go to http://www.apachelounge.com/download/. Scroll down the page until you find the download for the ‘Apache 2.4 win32 binaries‘ and download. You need to be careful that the module dll in PHP matches the version of Apache you install. Apache won‘t load otherwise.
  • Unzip the file into C:\. You should end up with a directory ‘Apache24‘ (or whatever the latest version is).
  • Find Start > All programs > Accessories > Command Prompt...... BUT, right click, and select ‘Run as administrator‘.
  • Enter the following commands
   cd \Apache24\bin
   httpd -k install
   httpd -k start

...you may well get a warning about the server name. Don‘t worry about it. Don‘t close this window, you will need it again in a minute.

  • To test it worked type ‘http://localhost‘ into your browser. You should get a screen up to the effect that Apache is installed and working.

Step 3: Install PHP

  • Now install the PHP scripting language on your PC. Go to http://www.php.net/download. In the current stable release section click on link for Windows 5.x.x binaries and source. Scroll down to the newest ‘Zip‘ for VC11 x86 Thread Safe (non thread safe doesn‘t have the Apache dll) PHP (again, the newest versions of PHP didn‘t have this but it shouldn‘t matter) and download. *Don‘t* be tempted to use the Microsoft Installer version; it won‘t work.
  • Open the zip file and extract to C:\PHP\

Step 4: Configure Apache and PHP

You now need to edit Apache‘s httpd.conf file. In the file explorer navigate to C:\Apache24\conf\httpd.conf. Open it in Notepad . At the end of this file (or wherever you like if you want to be more organised) add the following lines:

   LoadModule php5_module "C:/PHP/php5apache2_4.dll"
   AddHandler application/x-httpd-php .php
   PHPIniDir C:/PHP

The version of the module file matters (2_4 in this case). It MUST match the Apache version installed.

In the same file. Search for the line starting DirectoryIndex. Change it as follows

   DirectoryIndex index.php index.html

Now, navigate to C:\PHP, and copy php.ini-development to php.ini. Edit this file, find the following lines and modify them as follows (all should exist already):

   memory_limit = 256M
   post_max_size = 128M
   upload_max_filesize = 128M

You need to specify the extensions required for Moodle. Find the ‘Dynamic Extensions‘ section and change the following lines (uncomment and add the correct path):

   extension=c:/php/ext/php_curl.dll
   extension=c:/php/ext/php_gd2.dll
   extension=c:/php/ext/php_intl.dll
   extension=c:/php/ext/php_mbstring.dll
   extension=c:/php/ext/php_mysqli.dll
   extension=c:/php/ext/php_openssl.dll
   extension=c:/php/ext/php_soap.dll
   extension=c:/php/ext/php_xmlrpc.dll

(these are a minimum. You may need others - e.g. LDAP - for specific functions) ...and save.

Back in the ‘cmd‘ window for Apache, you need to restart it to load your changes...

   httpd -k restart

Step 5: Test your install

Navigate to C:\Apache24\htdocs and create a file called ‘test.php‘. I had to change a file explorer setting to create .php files - Organise > Folder and search options > View and then untick ‘Hide extensions for known file types‘.

In this file enter the single line...

   <?php phpinfo();

And then, in your browser, navigate to http://localhost/test.php. You should see a screen with masses of information and the PHP logo at the top. Check a few lines down for ‘Loaded Configuration File‘ and make sure it says c:\php\php.ini.

That‘s PHP and Apache all working :)

Step 6: Install Git

We will use the Git version control system for loading and updating the Moodle software. If you really don‘t want to do this you can just download the latest Moodle zip file and unzip it in c:\Apache24\htdocs but Git makes updates MUCH easier. We need to install Git first...

  • Go to http://msysgit.github.com. Navigate to ‘Downloads‘ and download/run the latest installer.
  • Accept defaults until you get to ‘Adjusting your PATH environment‘. Select ‘Run Git from the Windows Command Prompt‘ at this point.
  • Accept remaining defaults and install
  • If you right click on folders in the file explorer you should now see additional Git commands.

Step 7: Install Moodle

  • In the file explorer navigate to C:\Apache24\htdocs.
  • Inside the folder, right click and select Git GUI
  • Select ‘Clone existing repository‘
  • Use the following settings for the clone...
   Source location: https://github.com/moodle/moodle.git
   Target directory: C:/Apache24/htdocs/moodle

(You can also try git://git.moodle.org/moodle.git. Depending on your firewall situation one may work and the other not. The code is the same.)

  • Click ‘Clone‘. Depending on your network speed, this may well take a while as the whole Moodle history is being downloaded.
  • You should now have a ‘moodle‘ directory inside ‘htdocs. Right click and select ‘Git GUI‘ again - a more complex screen should now appear
  • Click on the ‘Branch‘ command and then ‘Checkout...‘.
  • Select the version of Moodle you want from the list, probably origin/MOODLE_24_STABLE. Make sure ‘Tracking branch‘ is selected and click Checkout.
  • Create a data directory for Moodle. It can be anywhere you like but I used C:\moodledata. Just create an empty folder
  • Go to http://localhost/moodle. The language select page should come up and you are away. The installation is not covered in detail here but...
    • Data directory is C:\moodledata (or whatever you created)
    • Database user is ‘root‘ (unless you created a more restricted user)
    • Database password is whatever you set installing MySQL

That should be it! Time for a cup of tea.

Upgrading Moodle

Category:

时间: 2024-08-24 11:22:25

Manual install on Windows 7 with Apache and MySQL的相关文章

Windows手动安装Apache,MySql服务

绿色版的Apache,Mysql需要以服务方式运行.或者由于某种原因服务管理器里面没有服务项了,可以进行手工注册服务和启并服务. # Apache Apache进到安装目录的bin目录下,运行dos命令,-n后接要注册的服务名称 * 安装与启动 httpd -k install -n "Apache" httpd -k start -n "Apache" * 停止与卸载 httpd -k stop -n "Apache" httpd -k uni

windows下搭建Apache+PHP+Mysql环境

php开发环境的搭建是困扰新手们学习php 的第一道难题,很多童鞋为了省事经常直接安装wamp集成软件,这样虽然方便了新手童鞋,但是,个人觉得,这样对于学习PHP及后期理解PHP原理会造成相当的困扰,很多童鞋甚至编码过程中出了错也不会解决,因为不知道是环境出错了还是编码出错了. Apache环境 Apache官网:http://httpd.apache.org/ 官网只提供源代码下载,并不提供Windows下二进制文件,因此需要在第三方下载编译好的二进制文件,官方推荐apachehaus. 步骤

windows下配置Apache+PHP+Mysql环境

1.下载相关安装包 Apache下载: http://archive.apache.org/dist/httpd/binaries/win32/ ,选择httpd-2.2.25-win32-x86-no_ssl.msi PHP下载: http://windows.php.net/downloads/releases/archives/ ,选择 php-5.3.5-Win32-VC6-x86.zip MySQL下载: http://downloads.mysql.com/archives/comm

Windows下卸载Apache、Mysql

卸载Apache 1. 停止服务 2.以管理员身份打开命令环境 3. 删除Apache文件目录 卸载Mysql 一.在控制面板,卸载MySQL的所有组件控制面板-->所有控制面板项-->程序和功能,卸载所有和MySQL有关的程序 二.找到你的MysQL安装路径,看还有没有和MySQL有关的文件夹,全删 如果安装在C盘,检查一下C:\Program Files (x86)和C:\Program Files 这两个文件夹 三.删除关于MySQL的注册表 在文件资源管理器中输入"C:\Wi

ubuntu下的apache+php+mysql的安装

平时我都时在windows下搭配apache+php+mysql环境的,只不过后来听别人说在linux下搭配apache+php+mysql更受欢迎,而且一般公司也是用这样的搭配,所以今天在试着在ubuntu中搭配的lamp环境. 在ubuntu我是使用命令来安装的,这也是比较方便和简单的方法. 1.先安装apache      在终端输入如下命令: 1 sudo apt-get install apache2 待显示完成,我们可以输入如下命令重启apache: sudo /etc/init.d

Ubuntu下在线安装Apache+PHP5+MySQL

1  安装Apache sudo apt-get install apache2 安装apache2 apache2安装完成以后,启动文件是/etc/init.d/apache2. sudo /etc/init.d/apache2 start 启动apachesudo /etc/init.d/apache2 stop 关闭apachesudo /etc/init.d/apache2 restart 重启apache apache2配置文件在/etc/apache2/httpd.conf ,初始文

centos7 搭建lamp(Apache PHP Mysql环境)

安装apache yum -y install httpd 安装Php yum -y install php 安装php-fpm yum -y install php-fpm 安装Mysql yum -y install mysql 安装 mysql-server wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm rpm -ivh mysql-community-release-el7-5.noarch.

说干就干——搭建基于Windows + Apache + PHP + MySQL的Moodle平台

说起Moodle,我相信学习教育技术的同学应该都不陌生,在大学的网络与远程教育课中,我有幸与传说中的Moodle相遇,然后相知,但是我绝对不会跟你们说一直到我毕业,我都没有找到一个合适的时间与这位Ms.Moodle相识,尽管我知道她对我蛮有好感!这是为什么呢?为什么呢?为……呢?好吧,我承认,我之所以没能好好认识一下Moodle,无外乎Moodle一直以来给我的感觉就一个:配置起来异常繁琐,不仅安装步骤甚多,需要安装的软件甚多,而且稍不注意就会出错,出错不要紧呀,要紧的是一个芝麻大的错还需要花大

windows下安装Apache、php、mysql集成环境

一.准备工作 本次安装的版本分别为:apache2.4  .php5.6 . mysql5.7 下载地址为:http://pan.baidu.com/s/1boQNIOn 密码:zarx 二.安装步骤 先安装apahce ,然后安装php,最后安装mysql. 作为一个web集成环境,必然是先安装apache的,而apche的响应得靠php来反馈,php的数据又得从mysql里面获取,因此整个流程安装,是先apache, 再php,最后mysql. 三.安装Apahce 安装    由于本次下载