Symfony學習筆記(1):安裝


---恢復內容開始---

1,下載Symfony

  到Symfony官網下載框架,網站為:http://www.symfony.com/。

2,解壓到項目根目錄下面,Symfony文件夾的結構如下:

www/ <- 你的站點根目錄
    Symfony/ <- 壓縮包里的Symfony目錄
        app/
            cache/
            config/
            logs/
        src/
            ...
        vendor/
            ...
        web/
            app.php
            ...
3,訪問 http://127.0.0.1/ShopCar/Symfony/web/config.php,出現界面如下:

 
        
出現問題如下:
1.Install and enable the mbstring extension.
解決方法,安裝mstring擴展,方法可以參考 http://www.cnblogs.com/lufangtao/archive/2012/12/30/2839679.html中的mysqli安裝過程,安裝完成后界面顯示如下:
2,問題2:Install and enable the intl extension (used for validators)
解決方法同上,解決完成后的界面如下:
3.問題3:Install and enable a PHP accelerator like APC
解決方法:
 
login to server as root and run the following commands:

Code:
cd ~ 
mkdir setups
cd setups 
wget http://pecl.php.net/get/APC-3.1.5.tgz 
tar -xvf APC-3.1.5.tgz 
cd APC-3.1.5
phpize
./configure --enable-apc --enable-apc-mmap --with-apxs --with-php config=/usr/local/bin/php-config
make
if you get the error:
Code:
In file included from /usr/local/src/APC-3.1.5/apc.c:38:
/usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
In file included from /usr/local/src/APC-3.1.5/apc.c:38:
/usr/include/php/ext/pcre/php_pcre.h:45: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/include/php/ext/pcre/php_pcre.h:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/include/php/ext/pcre/php_pcre.h:52: error: expected specifier-qualifier-list before 'pcre'
/usr/local/src/APC-3.1.5/apc.c:362: error: expected specifier-qualifier-list before 'pcre'
/usr/local/src/APC-3.1.5/apc.c: In function 'apc_regex_compile_array':
/usr/local/src/APC-3.1.5/apc.c:419: error: 'apc_regex' has no member named 'preg'
/usr/local/src/APC-3.1.5/apc.c:419: error: 'apc_regex' has no member named 'preg'
/usr/local/src/APC-3.1.5/apc.c:420: error: 'apc_regex' has no member named 'nreg'
/usr/local/src/APC-3.1.5/apc.c:420: error: 'apc_regex' has no member named 'nreg'
/usr/local/src/APC-3.1.5/apc.c: In function 'apc_regex_match_array':
/usr/local/src/APC-3.1.5/apc.c:452: error: 'apc_regex' has no member named 'preg'
/usr/local/src/APC-3.1.5/apc.c:452: error: 'apc_regex' has no member named 'preg'
/usr/local/src/APC-3.1.5/apc.c:453: error: 'apc_regex' has no member named 'nreg'
/usr/local/src/APC-3.1.5/apc.c:453: error: 'apc_regex' has no member named 'nreg'
make: *** [apc.lo] Error 1
Then you need to install pcre and make sure you do this from the / directory or it will not install.
Code:
yum install pcre-devel
Again do:
Code:
make
If no errors then do:
Code:
make install
update php.ini through WHM PHP Configuration Editor. Switch to Advanced and find Section:Core Directive:extension and add this to the end of the list:
Code:
, apc.so
Then restart apache and your done. the phpinfo function should show that APC is installed

Hope this helps someone.
 
解決后的界面如下:
 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM