Development

Install (diff)

You must first sign up to be able to contribute.

Changes between Version 7 and Version 8 of Install

Show
Ignore:
Author:
davedash (IP: 24.118.215.68)
Timestamp:
12/28/07 05:07:03 (9 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Install

    v7 v8  
    1 Original can be found on: [http://www.lucas-ts.com/tutoriais/lighttpd_php5/index.php] 
    2  
    3  
    4 = Install Symfony Framework over lighttpd = 
    5  
    6  
    7 == Objective == 
    8    At end , our give a symfony framework  instaled and working great. 
    9  
    10 == Installing lighttpd web server == 
    11    I install it via apt-get ( yes, during this tutorial i use debian gnu/linux with kernel 2.6.17 :-] ). Per default lighttpd run in  port 80, but the idea it is a alternative web server installing it on port 81. If apache installed, please stop. 
    12        
    13  
    14     {{{ # apt-get install lighttpd }}} 
    15  
    16  
    17     Now, lighttpd is installed on port 80, in soon our change this.ok!  
    18       
    19     '' Ps.: Slack Users, RedHat like users, and users of others gnu/linux distros, please use distro oficial format to install lighttpd. '' 
    20  
    21 == Installing needs to PHP == 
    22  
    23     When compile PHP, it need a some libs instaled on system, like png, jpeg, zlib and others. 
    24  
    25  
    26     {{{ # apt-get install libpng12-dev libgd-dev libpng12-dev libjpeg62-dev zlib1g-dev libmysql++-dev postgresql-dev libpq-dev libpq4 libxml2-dev }}} 
    27  
    28     All {{{ dev }}}, indicate development package ( ak. headers ). 
    29  
    30     '' Note: libpq4 is to Postgresql 8.x and libpq3 is to 7.x '' 
    31  
    32    '' Obs: This a libs i need, maybe you need others, please, verify if ./configure return some error, and try install lib. '' 
    33  
    34  
    35 == Some adjustments before compiling. == 
    36  
    37    Go edit lighttpd.conf,  
    38  
    39     
    40    {{{ # vim /etc/lighttpd/lighttpd.conf }}} 
    41  
    42     
    43    Find line {{{  server.port = 80 }}} and change 80 to 81. 
    44    {{{ 
    45         ######### Options that are good to be but not neccesary to be changed ####### 
    46  
    47         ## bind to port (default: 80) 
    48         server.port               = 81 
    49  
    50         ## bind to localhost only (default: all interfaces) 
    51         server.bind                = "localhost" 
    52     }}} 
    53  
    54     Ok, restart lighttpd and you can start apache again. 
    55  
    56     Now, verify {{{ http://localhost/ }}} ( Apache Home ) and {{{ http://localhost:81/ }}} (lighttpd placeholder ) 
    57  
    58 == Compiling PHP 5 == 
    59    Finally funny part! :-]  
    60  
    61    but, before start, 3 lessons 
    62  
    63    * Gives attention in the messages 
    64    * Gives MUCH attention in the messages 
    65    * Don't scare with the messages 
    66  
    67   === Download PHP === 
    68    Enters in PHP Downloads area and download tar.bz2 of the stable version ( Complete Source Code). 
    69  
    70    Saves this archive in /tmp/ 
    71     
    72   === Unpack ===  
    73    {{{ # tar - jxvf php-5.1.4.tar.bz2 }}} 
    74  
    75    will be created folder php-5.1.4 in /tmp, being /tmp/php-5.1.4/ 
    76  
    77             
    78    {{{ # cd /tmp/php-5.1.4/  }}} 
    79              
    80  
    81   === To configure Compilation === 
    82    {{{ 
    83 # ./configure --enable-fastcgi --with-gd --with-mysql --with-pgsql --with-zlib --with-pear=/opt/php5-cgi/pear --prefix=/opt/php5-cgi --with-libxml-dir=/usr/lib/ 
    84    }}} 
    85  
    86  
    87              This, the bash ./configure  way fastcgi ( --enable-fastcgi), compiles with gd, mysql, postgresql ( --with-pgsql) and zlib (compression library), parameter --to with-pear=/opt/php5-cgi/pear informs to install pear in the specified dir, --prefix=/opt/php5-cgi informs in which dir wants the installation of the PHP and for I finish we inform the way of libxml (  --with-libxml-dir=/usr/lib/). 
    88           
    89         Make 
    90              If ./configure will have had success, compels and installs: 
    91              # make && make install 
    92              Now, va to take a coffee, to play play2, binds pra woman alone pra to give one oi, therefore make leads around 15 minutes to compile everything, make install is rapido, thing of 20 seconds and it it places the things in the place. 
    93              (…) to after 15 you draft (…) 
    94              It looks at that beauty. we have everything soon. it enters in the diretorio of installation, the scratch will have been followed sera /opt/php5-cgi/, and of one looked at. 
    95  
    96 Configuring 
    97     PHP 
    98        It enters in the diretorio of the PHP: 
    99        # /opt/php5-cgi 
    100  
    101        We now go to copy php.ini 
    102        # cp /tmp/php-5.1.4/php.ini-dist /opt/php5-cgi/lib/php.ini 
    103  
    104        E clearly, we go to give a small one arranged to function as symfony: -) 
    105        # I came /opt/php5-cgi/lib/php.ini 
    106        Magic_quotes_gpc locates variavel of configuration, that it must be setada as On, modifies for Off being thus: 
    107         ( ... ) 
    108         ; Magic quotes will be incoming GET/POST/Cookie dates. 
    109         magic_quotes_gpc = Off 
    110         ( ... ) 
    111         It uses to advantage and it locates tambem the section on session (: -]), descomente to var of config session.save_path and seven it stops /tmp, or dir that the PHP has writing right during the execution. 
    112         ( ... ) 
    113         ; octal where MODE is the representation of the mode. It notices that this 
    114         ; you donate not overwrite the process's umask. 
    115         session.save_path = “/tmp” 
    116         ( ... ) 
    117  
    118        : -), PHP now this prontinho to twirl! 
    119     lighttpd 
    120          It enters in the diretorio of configuration disponiveis. 
    121          # compact disc /etc/lighttpd/conf-available 
    122  
    123         It edits the archive of configuration of fastcgi 
    124         # I came 10-fastcgi.conf 
    125  
    126        Delete all the original conteudo, and leaves thus 
    127 #********************************************************************* 
    128 server.modules += (“mod_fastcgi”) 
    129  
    130 to fastcgi.server = (“.php” => 
    131                                                 ( "*" => 
    132                                                     (“socket” =>” /tmp/php5-fcgi.socket ", 
    133                                                       “bin-path” =>” /opt/php5-cgi/bin/php " 
    134                                                     ) 
    135                                              ) 
    136                                 ) 
    137 #********************************************************************* 
    138                     
    139         After this, qualifies modulates it 
    140         # lighty-enable-mod fastcgi 
    141        
    142        Opa, we go to give one restart in lighttpd 
    143        # /etc/init.d/lighttpd restart 
    144  
    145         Rapido test, creates a /var/www/info.php archive (I am assuming that dir root is /var/www/) with the conteudo <? php phpinfo (); >, opens its navigator and points with respect to http://localhost:81/info.php, if to see that traditional screen with the information of the PHP, and to specify the version certinho with fastcgi. otimo, really everything left as waited, if not, it revises the steps. 
    146  
    147 Go Symfony, go! 
    148     We now go the installation of symfony, that sera installed way to pear. 
    149  
    150     First, we go for the direitorio bin of php. 
    151     # compact disc /opt/php5-cgi/bin 
    152     
    153     Now, we bring up to date pear 
    154     # ./pear upgrade PEAR 
    155  
    156     Beauty, hour to add the canal of symfony, ahhh, needs connection web is clearly (proxy will be being been using, export http_proxy= " http://ip:porta ") 
    157     # ./pear to channel-discover pear.symfony-project.com 
    158  
    159     Finally we install symfony, in the case the beta (trunk/night-build) 
    160     # ./pear install symfony/symfony-beta 
    161  
    162     We need to install tambem the Phing 
    163     # ./pear install http://phing.info/pear/phing-current.tgz 
    164  
    165     Ok, now we go to correct a small detail, in case that voce has tambem another version of php installed, we will change executavel of php with respect to which symfony points. 
    166     # I came /opt/php5-cgi/bin/symfony 
    167     Being with the opened archive, it locates the line: 
    168         export PHP_COMMAND=php 
    169     It modifies stops: 
    170         export PHP_COMMAND=/opt/php5-cgi/bin/php 
    171  
    172     To finish we create one link for the binario of symfony 
    173     # ln - s /opt/php5-cgi/bin/symfony /usr/bin/symfony 
    174     
    175     For forehead, it uses a keyboard in the terminal 
    176     # symfony - T 
    177     If to appear a list of options of symfony, ok, we are going well. 
    178     
    179 Symfony at lighttpd 
    180     Soon, we have everything to function, lighttpd installed, php compiled and symfony installed. 
    181  
    182     We go to create a folder for our project symfony of test 
    183     # to mkdir /var/www/symfony-teste 
    184     # compact disc /var/www/symfony-teste 
    185     
    186     We have the diretorio, now we go to create the structure 
    187     # symfony new symfony-test 
    188     It verifies the diretorio (ls - la) must have been bred one serie of diretorios (app, lib, date, web, and etc.) 
    189  
    190     We go to create one blog as application has tested 
    191     # symfony app blog 
    192     
    193     E one I modulate Test 
    194     #symfony modulates blog Test 
    195  
    196     We go to modify index padrao. 
    197     #vim apps/blog/modules/Teste/templates/indexSuccess.php 
    198     Codigo HTML places any, or modifies what ja exists. 
    199  
    200     Now the final test, to abrar the navigator, and points with respect to http://localhost:81/       
    201     ooopsss. 
    202     It swims? it lacked some thing? 
    203     Clearly, we need to inform lighttpd, for this opens lighttpd.conf again 
    204     # I came /etc/lighttpd/lighttpd.conf 
    205     Server.document-root locates config and modifies of what it will be stops 
    206     server.document-root = “/var/www/symfony-teste/web/” 
    207     
    208     After it locates this part: 
    209 $HTTP [“host”] == “localhost” { 
    210     alias.url += ( 
    211         “/doc/” => “/usr/share/doc/”, 
    212         “/images/” => “/usr/share/images/” 
    213     ) 
    214     dir-listing.activate = “enable” 
    215 
    216  
    217     It changes stops: 
    218     $HTTP [“host”] == “localhost” { 
    219     alias.url += ( 
    220         “/doc/” => “/usr/share/doc/”, 
    221         “/images/” => “/usr/share/images/”, 
    222         “/sf/” => “/opt/php5-cgi/pear/data/symfony/web/sf/” 
    223     ) 
    224     dir-listing.activate = “enable” 
    225 
    226  
    227     That is, we incluimos in the list of you unite the folder of symfony. 
    228  
    229     Now yes, it restarts lighttpd again, it opens the navigator and it points of this time with respect to http://localhost:81/blog_dev.php/Teste, voce must visualize the rederização of that archive that we modify previously. 
    230  
    231 Conclusion 
    232     He was this staff, any error or problem, order an email to me (domluc at gmail dot with), that I will answer rapido possivel. 
    233  
    234 All 
    235  
    236     *     Virtual Host for each project 
    237  
    238  
    239 == Rewriting .htaccess to LightTPD == 
    240 {{{ 
    241     alias.url            = ( 
    242         "/sf"           => "/usr/share/php/data/symfony/web/sf" 
    243     ) 
    244  
    245     url.rewrite-once = ( 
    246         "^/(.*\..+(?!html))$" => "$0", 
    247         "^/(.*)\.(.*)"        => "$0", 
    248         "^/([^.]+)$"          => "/index.php/$1", 
    249         "^/$"                 => "/index.php" 
    250     ) 
    251 }}} 
    252  
    253 Created in 07/08/2006 for Lucas Stephanou 
    254 It finishes Alteration 08/08/2006 
    255  
    256 License GPL 
    257  
    258  
    259 == Annotations == 
    260  
    261 If routing doesn't work and symfony defaults to 
    262 match route [homepage] "/" 
    263 then you should look closely at the output of phpinfo(): Most likely you have an empty $_ENV but $_SERVER is populated. Therefore you need to set this in apps/yourapp/config/settings.yml: 
    264  
    265 {{{ 
    266 all: 
    267   .settings: 
    268     path_info_array:        SERVER 
    269     path_info_key:          ORIG_PATH_INFO 
    270 }}} 
    271  
    272 The second setting is what fabien wrote with respect to a unset $QUERY ticket: www.symfony-project.com/trac/ticket/1355  
    273  
    274 cprior on [[Timestamp]] 
     1Moved to [wiki:lighttpd]