Skip to content

Instantly share code, notes, and snippets.

@maltzsama
Last active December 16, 2015 08:19
Show Gist options
  • Select an option

  • Save maltzsama/5404748 to your computer and use it in GitHub Desktop.

Select an option

Save maltzsama/5404748 to your computer and use it in GitHub Desktop.
Setup MySQL + Lighttpd + PHP5 + Debian Squeeze (6.0.5)
sudo su
#1 - Instalacao básica do MySQL
apt-get install mysql-server mysql-client
#Informe uma senha para o usuário root do MySQL
#Password - PASSWORD
#2 - Instalar Lighttpd
apt-get install lighttpd
#As páginas do lighttp devem ficar no /var/www
#Crie um arquivo /var/www/index.html e entre no ip da maquina que esta configurando para testar se o lighttpd funcionou corretamente
#3 - Instalando PHP5
apt-get install php5-cgi
#4 - Configurando Lighttpd e PHP5
#Para habilitar o PHP5 no Lighttpd precisamos modificar o arquivo /etc/php5/cgi/php.ini e descomentar a linha cgi.fix_pathinfo=1.
vim /etc/php5/cgi/php.ini
#Descomente a linha acima mencionada
[...]
; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting>
; of zero causes PHP to behave as before. Default is 1. You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://php.net/cgi.fix-pathinfo
cgi.fix_pathinfo=1
[...]
#Para habilitar o fastcgi (que esta armazenado em /etc/lighttpd/conf-avaliable/10-fastcgi.conf), rode os seguintes comandos:
lighttpd-enable-mod fastcgi
lighttpd-enable-mod fastcgi-php
#O seguinte comando criará o symlink /etc/lighttpd/conf-enabled/10-fastcgi.conf que aponta para /etc/lighttpd/conf-available/10-fastcgi.conf:
ls -l /etc/lighttpd/conf-enabled
#Agora precisamos reiniciar o servico do Lighttpd
/etc/init.d/lighttpd force-reload
#5 - Testando o PHP5
vim /var/www/info.php
#Use o Seguinte código
<?php phpinfo(); ?>
#6 - Colocado o suporte MySQL no PHP5
apt-cache search php5
apt-get install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
/etc/init.d/lighttpd restart
#7 - Instalando o PHPMyAdmin
apt-get install phpmyadmin
#Teste suas configurações
http://localhost/
http://localhost/phpmyadmin
#Tudo deve estar funcionando
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment