xampp下安装symfony

本文提供了一套详细的指南,教你如何使用Apache Friends XAMPP系统安装Symfony框架,并配置环境,包括路径设置、命令行操作、文件修改等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

//原文地址http://www.seiler.it/installing-symfony-framework.html 仅作记录

  1. Download a fresh copy of ApacheFriend XAMPP System.
    http://www.apachefriends.org/de/xampp-windows.html
  2. Set right include path and to make sure that all pear packages will be installed in the right locations.
    1. Goto System Properties into the Advanced tab.
    2. Click on Environment Variables
    3. Extend the path variable by adding your path to php, mysql and pear:
      In my case, as I installed XAMPP to d:\progs\xampp, it was like adding 
      ;d:\progs\xampp\php\PEAR\symfony;d:\progs\xampp\mysql\bin;d:\progs\xampp\php;d:\progs\xampp\php\PEAR
  3. Open a command line (Start menu, Start Application, Run "cmd"
  4. Enter your XAMPP directory:
    d:
    cd progs\xampp
    (This can be different for you!)
  5. Upgrade pear:
    pear upgrade pear
  6. Install phing:
    pear install -a http://phing.info/pear/phing-current.tgz --alldeps
  7. Install symfony:
    1. pear channel-discover pear.symfony-project.com
    2. pear install symfony/symfony
  8. Update your \xampp\apache\conf\httpd.conf:
    #
    # Use name-based virtual hosting.
    #
    NameVirtualHost myproject:80

    #access to /sf - directory

    Allow from All

    #symfony myproject

    ServerName myproject
    DocumentRoot "d:\progs\xampp\htdocs\myproject\web"
    DirectoryIndex index.php
    Alias /sf "D:\progs\xampp\php\PEAR\symfony\data\web\sf"


    AllowOverride All
    Order allow,deny
    Allow from All




  9. Update your C:\WINDOWS\system32\drivers\etc\hosts:
    127.0.0.1         localhost
    127.0.0.1         myproject
    	
  10. Start console again and goto xampp\htdocs and create the directory "myproject" there.
  11. Run symfony generate:project myproject
  12. Run symfony generate:app frontend
    (This assumes, you will need a app called frontend.)
  13. Open http://myproject/ in your browser. You should see the default symfony page, saying:
    "Symfony Project Created Congratulations! You have successfully created your symfony project."
  14. Start your own Symfony project now!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值