Setting up a local development plattform on windows using xampp

You can download a copy of xampp here: http://www.apachefriends.org/en/xampp-windows.html.

Klick on download xampp to get your copy. (XAMPP stands for X = cross-platform, Apache, MySQL, PHP and Perl)

Xampp is very popular and the best is its opensource and free. In the xampp package there is also a copy of phpmyadmin which is very usefull to administer your database. In the xampp package there are also other interesting tools like xdebug, apc and lots more...

You can also use another package like wamp (server) or mamp if you want to develop on a mac.

Click on the downloaded xampp.exe to install the package on your computer. Follow the steps of the setup wizard. After the installation finished, you will get asked if xampp should locate the pathes, press "Y" to accept or enter "N" to deny and press "ENTER" (i recommend you press "Y"). Then confirm by pressing "Y" again.

Then xampp asks you if you want xampp to be installed as portable version, this is nice because you can put xampp on your usb stick and use it on different computers, the disadvantage you won't be able to start xampp as a service, i only have one computer and don't like to start my xampp every time i restart my computer. Therefore i have choosed to enter "N".

The last step helps you configure several components. Press ENTER (RETURN) to accept the default php timezone. You will be able to change this later. Now you get asked what next step should be, press "1" to launch the xampp control panel. Installation is now finished, you can close the window. I recommend that you don't use the control panel just yet. Press the exit button, before launching apache and mysql we will change some options in the configuration files first.

Now we should create a virtual host. This is important because later we will have several websites and its easier to manage them if each one has its own domain. For our app we will create a domain www.myapp.dev.

To create a new virtual host you first must open the PATH_TO_XAMPP/xampp/apache/conf/extra/httpd-vhost.conf file. Your file content should look like this (for example for me "PATH_TO_XAMPP" is "C:"):

1
2
3
4
5
6
7
8
9
10
11
12
NameVirtualHost *:80
  
<VirtualHost *:80>
     ServerName myapp.dev
     DocumentRoot PATH_TO_XAMPP/xampp/htdocs/myapp/public
     <Directory PATH_TO_XAMPP/xampp/htdocs/myapp>
         DirectoryIndex index.html index.php
         AllowOverride All
         Order allow,deny
         Allow from all
     </Directory>
</VirtualHost>



The DirectoryIndex directive sets the list of resources to look for, when the client requests an index.

You must have "AllowOverride All" in effect if you to allow that your htaccess can override all the directives declared previously. We will use the htaccess to set most of our directives because its a little bit more flexible then the apache conf. The advantage is that you don't have to reload / restart apache after changing a directive in your htaccess. If you change a directive in the conf file you must reload / restart apache to activate the directive.

Order allow,deny means that first, all "allow" directives are evaluated, at least one must match, or the request is rejected. Next, all "deny" directives are evaluated. If any matches, the request is rejected. Last, any requests which do not match an Allow or a Deny directive are denied by default.

(You could for example use Allow from "your own IP" to only allow yourself to access the website until you finished testing it, or use Deny from "add an IP here that you want to block" to block an IP)

More about the directory directive: http://httpd.apache.org/docs/1.3/mod/core.html#directory

Now you must open your windows hosts file. Open your text editor but click on "run as administrator" or you wont be able to save the file. The hosts file can be found here: PATH_TO_WINDOWS/System32/drivers/etc/hosts (for example for me "PATH_TO_WINDOWS" is "C:/Windows"). If you can't find the folder it might be hidden. Open the windows directory, then press the "Alt-Key", now click on "Tools" and then "Folder Options". Finally choose on the "View" tab and then find the "Hidden files and folders" option, then click on the "Show hidden files, folders, and drives" radio button.

Add these two lines to it:

1
2
127.0.0.1       localhost
127.0.0.1       www.myapp.dev



Then save the file.

When you have finished configuring Apache you should open the xampp control panel, if awindows firewall popup comes up click on unblock to add a rule for xampp. To start Apache click in the control on start, then click on the Mysql start button. I recommend you start both as a service, if you check the service checkbox (Svc) before starting then you wont have to start them every time you restart your computer.

To open phpmyadmin use this path: http://localhost/phpmyadmin/

To see your website go to: http://www.myapp.dev

UPDATE 1: If xampp's apache doesn't start then try those two things:

1) Perhaps your port 80 is already being used by another program for example by skype. It's easy to check if the port 80 is available, open the xampp control panel an press the "port check" button on the right. If xampp tells you that the port is being used by another program, ou will have to change the port on which apache should listen. Open the httpd.conf located here: PATH_TO_XAMPP/xampp/apache/conf/httpd.conf. Find the line "Listen 80" and change it to use another port, for example "Listen 8080".

2) You perhaps have a conflict in your php.ini (php configuration file), your httpd.conf (apache configuration file) or the vhosts.conf (apache virtual hosts configuration file). To check if apache found an error, check your logs that are located here: PATH_TO_XAMPP/xampp/apache/logs/. If there is a conflict in one of your configuration files you should fine an error msg in the logs. Copy the error message and do a search in google.

UPDATE 2: Install, enable apc (Alternative PHP Cache / opcode cache)

In older version of xampp you had to install apc, but anymore, modern version of xampp have a preinstalled apc .dll but it's not enabled by default.

To enable apc, open your php.ini and find the following line: "extension=php_apc.dll", uncomment that line and save your php.ini (PATH_TO_XAMPP/xampp/php/php.ini). Your done, now you only need to restart apache.

If you want to check if apc got enabled, use the phpinfo function and check if you find a block called "apc". Put the following code in a file called info.php and copy the file to your root folder, then open it in your browser: "http://www.myapp.dev/info.php".

1
phpinfo();



原文地址:http://www.chris.lu/en/news/show/4d40937fafbbe/


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Origin Beta安装包是由EA公司开发的一款游戏客户端软件,它提供了多种游戏的下载和安装服务,包括EA出品的游戏,例如《FIFA》、《战地》等,以及其他游戏开发公司的游戏。 Origin Beta安装包的使用非常方便,用户可以通过官方网站或客户端下载安装包,并根据提示进行安装和注册。安装成功后,用户便可以在Origin Beta中搜索、下载和安装自己喜欢的游戏,同时也可以与其他玩家分享游戏心得和游戏截图。 除了提供游戏下载和安装服务外,Origin Beta还提供了一些社交功能,比如好友列表、聊天室、评论和评分等。用户可以在Origin Beta上与其他玩家交流、互动和竞技,增加游戏的乐趣和社交性。 总之,Origin Beta安装包是一款体验优秀的游戏客户端软件,为广大游戏玩家提供了丰富的游戏资源和社交平台,对于热爱游戏的人来说是不可或缺的工具。 ### 回答2: Origin Beta安装包是一种软件安装文件,它是由EA (Electronic Arts)公司开发的游戏平台Origin的测试版安装包。该安装包包含了最新的功能,修复了之前版本中的一些漏洞,提升了用户的游戏体验和界面交互。对于那些热爱游戏的用户来说,安装Origin Beta可以大大提高游戏的安装、更新和启动速度,并增加了更多的游戏内容和社交功能。 安装Origin Beta的过程并不难,用户需要先下载安装包,然后打开安装程序,按照提示进行安装。安装完成后,用户需要登录自己的账号,便可以开始使用Origin Beta了。用户可以在平台中浏览游戏、购买游戏并安装游戏等等。同时,Origin Beta还支持社交功能,用户可以在平台上结交志同道合的游戏玩家,分享游戏体验和游戏内容。 Total 300 words. Origin Beta ist eine Software-Installationsdatei, die von EA (Electronic Arts) entwickelt wurde. Es ist ein Testpaket der Spielplattform Origin. Diese Installation enthält die neuesten Funktionen, behebt einige Fehler von früheren Versionen, verbessert die Spielerfahrung und die Interaktion der Benutzeroberfläche. Für Benutzer, die Spiele lieben, kann die Installation von Origin Beta die Installationsgeschwindigkeit, den Aktualisierungsvorgang und die Startgeschwindigkeit des Spiels erheblich verbessern sowie mehr Spielinhalte und soziale Funktionen hinzufügen. Der Installationsprozess von Origin Beta ist nicht schwer. Benutzer müssen zuerst die Installationsdatei herunterladen und dann das Installationsprogramm öffnen, um der Anleitung zu folgen. Nach der Installation müssen Benutzer sich in ihr Konto einloggen und können dann mit der Verwendung von Origin Beta beginnen. Benutzer können auf der Plattform Spiele durchsuchen, Spiele kaufen und installieren und vieles mehr. Gleichzeitig unterstützt Origin Beta auch soziale Funktionen, Benutzer können auf der Plattform Gleichgesinnte Spieler treffen, Spielkosten und Spielinhalte gemeinsam nutzen. 300 Wörter insgesamt.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值