Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 5 Instalando Web Server no FreeBSD 6,0 a 2,2 Apache, MySQL e 5,0 PHP 5 - Parte 5
Installing Apache 2.2, MySQL 5 and PHP 5 in FreeBSD 6.0 for a Reliable Web Server Instalando 2,2 Apache, MySQL e PHP 5 em 5 FreeBSD 6,0 Confiável para um servidor da Web
Part 5 - Installing PHP Hypertext Preprocessor Scripting Language 5 and PHP 5 Extensions Parte 5 - Instalando PHP Hypertext Pré Scripting Language 5 e PHP 5 Extensões
- Install by enter the following commands on FreeBSD OS command line, wait for previous command to finish before running the next command: Instale a introduzir os seguintes comandos no SO FreeBSD linha de comando, esperar comando anterior para terminar antes de executar o próximo comando:
cd /usr/ports/lang/php5 CD / usr/ports/lang/php5
make install clean make install clean - If you’re prompted, select “use Apache 2.x instead”. Se você for solicitado, selecione "use Apache 2.x vez".
- Continue with the following commands to install PHP5 extensions and modules to enable the support of the modules in Apache: Continuar com os seguintes comandos para instalar PHP5 extensões e módulos para permitir o apoio dos módulos do Apache:
cd /usr/ports/lang/php5-extensions CD / usr/ports/lang/php5-extensions
make config make config - At Options for php5-extension 1.0 menu, select all PHP extensions and modules that you may use with Apache webserver. Opções para a prorrogação php5-1,0 menu, selecione todas as extensões PHP e módulos que você pode usar com servidor Apache. This is a part of the configuration for PHP, where you need to enable features of PHP that come in modules, such as ability to manage user sessions, interface with databases and many others. Esta é uma parte da configuração de PHP, onde você precisa ativar recursos do PHP que entram em módulos, tais como a capacidade de gerenciar usuários sessões, interface com bases de dados e muitos outros. Default extensions such as ctype functions support, HASH Message Digest Framework support, session support and etc have been selected. Padrão extensões como ctype funções apoio, hash Message Digest-Quadro apoio, etc sessão apoio e de ter sido seleccionado. Other popular extensions that you most likely to be in used are MySQL database support and GD library support. Outros populares extensões que você mais susceptíveis de serem utilizados no apoio e banco de dados MySQL estão GD biblioteca apoio. Use space bar to select or unselect the extensions and press Enter when done. Use barra de espaço para selecionar ou Desmarque a extensões e pressione Enter quando terminar.
- Continue the installation of php5-extensions with the following commands: Continue a instalação de extensões php5-com os seguintes comandos:
make install clean make install clean
- If there are any message the pops up and prompts you to select some options or configurations, you can just accept the default settings by pressing Enter. Se há alguma mensagem a surgir e pede-lhe para seleccionar algumas opções ou configurações, você pode simplesmente aceitar as configurações padrão pressionando Enter. Some modules that may prompt you for action include php5-gd, php5-mbstring and php5-sqlite. Alguns módulos que podem levar você para a acção inclui-gd php5, php5-mbstring e php5-SQLite.
- Edit the Apache configuration file in order to enable Apache web server to load the PHP modules when initialization: Edite o arquivo de configuração do Apache, de modo a permitir que o servidor web Apache para carregar os módulos PHP quando inicialização:
- Go to Apache configuration file location by cd /usr/local/etc/apache2/ Ir para o Apache arquivo de configuração local em cd / usr/local/etc/apache2 /
- Edit Apache configuration file by vi httpd.conf Editar arquivo de configuração com Apache vi httpd.conf
- Search for LoadModule lines, after the last LoadModule line, but within the same section, add the following 2 lines: Buscar LoadModule linhas, após o último LoadModule linha, mas dentro da mesma secção, adicione as seguintes linhas 2:
AddType application/x-httpd-php .php AddType aplicação / x-httpd-php. Php
AddType application/x-httpd-php-source .phps AddType aplicação / x-httpd-php-source. Phps
- Optionally, copy /usr/local/etc/php.ini-recommended or /usr/local/etc/php.ini-dist to /usr/local/etc/php.ini (in same directory), which will enable you to tune and change the default settings of behaviours of PHP. Opcionalmente, copiar / usr / local / etc / php.ini-recomendados ou / usr / local / etc / php.ini-dist para / usr / local / etc / php.ini (no mesmo diretório), o que lhe permitirá sintonizar e alterar as configurações padrão de comportamentos de PHP.
- Start the Apache HTTP web server by using apachectl start (or restart Apache HTTP web server by using apachectl restart). Inicie o servidor web Apache HTTP usando apachectl iniciar (ou reiniciar servidor web Apache HTTP usando apachectl restart). apachectl is located in /usr/local/sbin, if you encounter Command not found problem, try to change directory to its location. apachectl está localizado em / usr / local / sbin, se deparar com Comando não encontrado problema, tente alterar o diretório para a sua localização.
- PHP5 installation done. PHP5 instalação feito.
A web server has been setup with the FreeBSD with Apache, MySQL and PHP. Um servidor da Web foi configurado com o FreeBSD com Apache, MySQL e PHP. The document root of the web server (where you should put your HTML and PHP files is at /usr/local/www/apache22/data/ and you will need a SecureFTP (SFTP) client such as WinSCP to upload your files to web server securely. O documento raiz do servidor web (onde você deve colocar seus arquivos HTML e PHP é em / usr/local/www/apache22/data / e você terá uma SecureFTP (SFTP) WinSCP como cliente para fazer o upload de arquivos para seu servidor web segura.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Esta é uma página traduzida máquina que é fornecida "como está" sem garantia. Machine translation may be difficult to understand. A tradução automática pode ser difícil de compreender. Please refer to Por favor, consulte a original English article Inglês original article whenever possible. sempre que possível.
Share and contribute or get technical support and help at Compartilhe e contribuir ou obter suporte técnico e ajudar a My Digital Life Forums Minha vida digital Fóruns .
Related Articles Artigos relacionados
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4 Instalando Web Server no FreeBSD 6,0 a 2,2 Apache, MySQL e 5,0 PHP 5 - Parte 4
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 Instalando Web Server no FreeBSD 6,0 a 2,2 Apache, MySQL e 5,0 PHP 5 - Parte 3
- Easily Set Up Web Server with XAMPP Facilmente criado com o servidor web XAMPP
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 1 Instalar Web Server no Windows XP com Apache2, PHP5 e MySQL4 - Parte 1
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 3 Instalar Web Server no Windows XP com Apache2, PHP5 e MySQL4 - Parte 3
- FreeBSD Apache HTTP Accept Filter Error FreeBSD Apache HTTP aceitar filtro erro
- Using phpMyAdmin for Effective MySQL Management in Windows XP Usando phpMyAdmin para a Gestão Eficaz MySQL no Windows XP
- PHP 5 Unable to Open HTTP Request Stream with fopen or fsockopen Functions PHP 5 não foi possível abrir a solicitação HTTP Stream fopen ou fsockopen Funções
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database Ativar registro de Consultas Lento (Slow Query Log) no MySQL Database
- Enable MySQL InnoDB Storage Engine Support in XAMPP Installation Ativar MySQL motor de armazenamento InnoDB apoio na instalação XAMPP



















May 24th, 2006 10:23 24 de maio de 2006 10:23
Hi, I am trying to install, php5 with apache2.2 on freebsd 6.1. Oi, estou a tentar instalar, php5 com apache2.2 sobre FreeBSD 6,1. I have followed the instructions on this page. Tenho seguido as instruções nesta página. I can get apache running well, but php will not interpret any pages. Posso obter apache correr bem, mas o php não irá interpretar qualquer páginas. I have a file; info.php with in it, but when I load it from a browser it tries to *download* the php file not display it. Eu tenho um arquivo; info.php com no-la, mas quando eu carregá-la a partir de um navegador, tenta descarregar * * php o arquivo não exibi-lo. Furthermore, the httpd.conf does not have a entry to load the php module as a shared object. Além disso, o httpd.conf não possui uma entrada para carregar o módulo php como um objeto compartilhado. should it? Deve-lo? its as if apache has not idea how to process php’s. como se o seu apache não tenha idéia de como a do processo php. Any guideance would be appreciated! Qualquer guideance seria apreciada!
kind regards espécie respeita
May 24th, 2006 10:30 24 de maio de 2006 às 10:30
Did you add the followng lines to your httpd.conf? Será que você adicionar a followng linhas ao seu httpd.conf?
AddType application/x- httpd-php . AddType application/x- httpd-php. php PHP
AddType application/x- httpd-php-source . AddType application/x- httpd-php-source. phps
Normally, ports installation will auto update the httpd.conf with php5 load module. Normalmente, os portos instalação será a atualização automática httpd.conf com php5 carga módulo. Check if your httpd.conf has the following line, if not try to add: Verifique se seu httpd.conf tem a linha seguinte, se não tentar acrescentar:
LoadModule php5_module libexec/apache22/libphp5.so LoadModule php5_module libexec/apache22/libphp5.so
May 24th, 2006 11:54 24 de maio de 2006 11:54
Yes, I certainly did add the AddType’s Sim, eu certamente fez a acrescentar AddType's
the php5 port installation did not auto update httpd.conf with ‘LoadModule php5_module libexec/apache22/libphp5.so’. php5 a instalação portuária não httpd.conf com atualização automática 'LoadModule php5_module libexec/apache22/libphp5.so ". I would manually add it but the libphp5.so does not exist in the mentioned directory. Gostaria de adicionar manualmente a libphp5.so mas ela não existe no diretório mencionado. Any idea’s? Qualquer idéia's? I installed from the /usr/ports/lang/php5 port. Eu instalado a partir do / usr/ports/lang/php5 porto. I heard using /usr/ports/www/mod_php5 port may work. Ouvi usando / usr/ports/www/mod_php5 porto maio trabalho. Would/should it make any difference? Estaria / ela deveria fazer qualquer diferença?
May 24th, 2006 16:01 24 de maio de 2006 16:01
Hi Bruce, you may give mod_php5 a try, but I think you will lose some functionalities such as command line CLI. Oi Bruce, você pode dar um mod_php5 tentar, mas acho que você vai perder algumas funcionalidades tais como a linha de comando CLI. Or else try to make clean in php5 first. Ou então tente limpar a fazer na primeira php5. Reinstalling from Apache again worth a try too. Reinstalar a partir de Apache novamente vale a pena experimentar também. Note that you should install Apache first, and php5 will detect which version of Apache you’re running. Note que você deve instalar primeiro o Apache, e php5 irão detectar qual versão do Apache estiver sendo executado.
May 24th, 2006 16:11 24 de maio de 2006 16:11
Beside, make sure you updated to latest ports tree with Ao lado, certifique-se atualizado com a última portos árvore portsnap or ou cvsup CVSup .
May 29th, 2006 20:59 29 de maio de 2006 20:59
You might missed to install the php for apache, only cgi and cli. Talvez você perdeu para instalar o php para o apache, só cgi e cli.
CD /usr/ports/php5 CD / usr/ports/php5
make config make config
then então
make install clean make install clean
mayby you have to do mayby que você tem que fazer
make deinstall && make reinstall fazer deinstall & & make reinstalar
June 4th, 2006 10:48 4 de junho de 2006 10:48
When you add the following lines to httpd.conf file, make sure you removed the extra spaces (there are 2 extra spaces in the original article, following doesnt’t have). Quando você adicionar as seguintes linhas ao arquivo httpd.conf, certifique-se que os espaços extras removidos (existem 2 espaços extras no artigo original, após ter doesnt't).
AddType application/x-httpd-php .php AddType aplicação / x-httpd-php. Php
AddType application/x-httpd-php-source .phps AddType aplicação / x-httpd-php-source. Phps
June 7th, 2006 05:21 7o junho de 2006 05:21
I’m having the same problem as Bruce above. Estou tendo o mesmo problema como Bruce acima. I’m using FreeBSD 6.1, Apache 2.2, and PHP 5.1.4. Estou usando o FreeBSD 6,1, Apache 2,2, e PHP 5.1.4. My ports tree is fresh and synched. Meu portos árvore é fresco e sincronizada.
I installed the PHP5 port with Apache module support. Instalei o porto PHP5 com Apache módulo apoio. The installation completes without complaining, but there is no Apache module built. A instalação completa sem queixar, mas não existe um módulo Apache construída. The file /usr/local/libexec/apache22/libphp5.so does not exist. O arquivo / usr/local/libexec/apache22/libphp5.so não existe. It doesn’t exist anywhere else in the filesystem either. Ela não existe em nenhum outro lugar no sistema de arquivos. Something is broken with this port. Alguma coisa está quebrada com essa porta. I see source files in the work directories , like /usr/ports/lang/php5/work/php-5.1.4/sapi/apache that look appropriate to this module… but are not getting compiled. Eu vejo o trabalho em arquivos fonte diretórios, como / usr/ports/lang/php5/work/php-5.1.4/sapi/apache que parecem adequadas para este módulo… mas não estão recebendo compilados. Any insights? Qualquer insights?
June 9th, 2006 20:41 9 de junho de 2006 20:41
Ahmet gave a working answer. Ahmet deu uma resposta de trabalho. I was having the same problems, until I noticed the extra space before the file extention, now everything works like a charm! Eu estava tendo os mesmos problemas, até que eu observei o espaço extra antes do arquivo extensão, agora, tudo funciona como um charme!
June 9th, 2006 20:59 9 de junho de 2006 20:59
Thanks for point out, has since corrected the error. Obrigado por assinalar, uma vez que tenha corrigido o erro.
August 28th, 2006 10:55 28 de agosto de 2006 10:55
Recompile php5 with ‘Apache Module’ included. Recompile php5 com 'Apache Module "incluído.
‘cd /usr/ports/lang/php5′ 'Cd / usr/ports/lang/php5'
‘make deinstall’ ignore warnings 'Make deinstall' ignorar advertências
‘make config’ make sure to select apache module 'Make config' certificar-se de selecionar módulo apache
‘make install’ 'Make install'
September 26th, 2006 16:37 26 de setembro de 2006 16:37
I’ve Done it successfully. Eu fiz isso com sucesso. It doesnt work.. Ela não funciona ..
How do i access it? Como faço para acessá-la?
ive typed Ive digitados http://192.168.1.9
November 29th, 2006 10:32 29 de novembro de 2006 10:32
Had run into the same problem as those above with the extra spaces in the AddType declaration but solved it before looking at the comments. Tiveram o mesmo problema em executar como aqueles acima com os espaços extras na AddType declaração, mas ela resolveu antes de olhar para os comentários. Would recommend updating the article as, all in all, this is a great tutorial. Recomenda a actualização do artigo como, no seu conjunto, este é um ótimo tutorial. Thanks. Obrigado.
Ben
November 29th, 2006 12:35 29 de novembro de 2006 12:35
Thanks Ben, have since corrected the error. Ben agradece, desde já corrigido o erro.
January 6th, 2007 16:50 6 de janeiro de 2007 16:50
I’m running into the same issue. Estou executando na mesma edição. My php files are trying to download instead. Meu php arquivos estão a tentar baixar vez.
I’ve gone over everything three and four times yet nothing. Eu já passaram mais de três e quatro vezes tudo ainda nada.
I’ve checked the additional spaces as well and no luck. Eu verifiquei o adicional bem como espaços e não sorte.
Any assistance is appreciated!! Qualquer ajuda é apreciada!
January 9th, 2007 22:05 9 de janeiro de 2007 22:05
I had same issue. Eu tinha mesmo assunto.
Try make config and unselect CGI and be sure to select APACHE. Tente fazer config e unselect CGI e certifique-se de selecionar APACHE.
Check at end of install that you have a line like:chmod 755 /usr/local/libexec/apache22/libphp5.so Verifique a fim de instalar que você tem uma linha como: chmod 755 / usr/local/libexec/apache22/libphp5.so
I config without CLI ang CGI. Eu config sem CLI Ler CGI.
March 16th, 2007 08:28 16 de março de 2007 08:28
Trying to install the package php5 without port sources via A tentar instalar o pacote php5 sem porto fontes via
pkg_add -r php5 pkg_add-r PHP5
only this doesnt install the apache module by the looks of it.. Só este não instalar o módulo apache pela aparência dele ..
nor does it build it.. nem que construí-lo ..
I dont want the sources on the server because it is to be a production server.. Eu não quero as fontes no servidor, porque é para ser servidor de produção .. i’m gunna try a reinstall… Eu sou um gunna tente reinstalar…
March 16th, 2007 08:36 16 de março de 2007 08:36
reinstall was unsuccessful reinstalar foi vencida
April 18th, 2007 05:40 18 de abril de 2007 05:40
I uninstalled, reinstalled making double sure to include the Apache model, still no dice. Eu desinstalado, reinstalado fazendo dupla esqueça de incluir o Apache modelo, ainda nenhum dado. So I uninstalled again and reinstalled without CLI and CGI and it still would startup no errors, but it would list the directories in document source and would treat cgi files as text files. Então eu desinstalado e reinstalado novamente sem CLI e CGI e ele ainda iria iniciar nenhum erro, mas seria lista dos diretórios em documento fonte e iria tratar cgi arquivos como arquivos de texto. All my configs were in order, so I thought maybe it needed a reboot… and walah. Todas as minhas configurações estavam em ordem, e pensei que talvez seja necessária uma reinicialização… e walah. Working like a charm. Trabalhando como um encanto.
I think Unix is for massochists =) Penso que é para Unix massochists =)
April 18th, 2007 05:42 18 de abril de 2007 05:42
edit.. Verifique .. I meant ” .. Eu significava ".. would treat PHP files as text files ..” and not CGI. ia tratar arquivos PHP como arquivos texto .. "e não CGI.
Long day =0 Long dias = 0
September 14th, 2007 17:03 14 de setembro de 2007 17:03
I’ve been trying to install Timetrex and it requires Apache, php and postgresql. Estive a tentar instalar Timetrex e que exige Apache, PHP e PostgreSQL. Postgresql is not a problem because I install it from source. PostgreSQL não é um problema porque eu instalá-lo a partir do código fonte. But as you can see from above, the FreeBSD ports system is so often in a state of flux that you’re not guaranteed anything that will work. Mas, como você pode ver a partir de cima, o FreeBSD portos sistema é tão frequentemente em estado de fluxo que você não está nada garantido que irá trabalhar.
On this issue, the bosses, and I myself got so fed up with the results from FreeBSD that we installed Fedora and then took the vendors installation file, which only works on Linux and got on with the task. Nesta questão, os patrões, e eu próprio obtive tão fartos com os resultados de FreeBSD que estamos instalados Fedora e, em seguida, tomou a instalação vendedores arquivo, o que só funciona em Linux e mãos à tarefa.
With so many dependencies and librairies to update, the FreeBSD ports system as left me feeling very cautious about using it and it harkens me back to the old M$ “dll - hell” days when Windows 3x and Win9x were such a pain to deal with. Com tantas dependências e bibliotecas para atualizar, o FreeBSD portos sistema como deixou-me sentir muito cautelosos ao utilizá-lo e ele harkens-me de volta ao velho M $ "dll - inferno" dias quando o Windows 3x e Win9x foi um tal de lidar com a dor .
November 30th, 2007 09:57 30 de novembro de 2007 09:57
This series of articles has been very, very helpful. Esta série de artigos tem sido muito, muito útil. Many thanks for your contribution! Muito obrigado pela sua contribuição!
December 11th, 2007 20:53 11 de dezembro de 2007 20:53
Should the problem with downloadable sourcecodes exist for anyone else, if it was just a problem occurring from localhost, changing the listening port from the default 80 to *:80 might help. Caso o problema com o download sourcecodes existem para ninguém, se era apenas um problema que ocorre a partir de localhost, mudando a ouvir a partir da porta padrão para 80 *: 80 poderia ajudar. It is highly likely that in the above mentioned cases Apache had not much to do with serving the files on localhost. É altamente provável que, nos casos acima mencionados Apache não tinha muito a ver com a servir os arquivos do localhost.
Fedora does not have less dependancies, they are just handeld elswehere out of user eyes. Fedora Core não tem menos dependências, eles são apenas handeld elswehere fora de usuário olhos.
Understanding the package & port system and when and why to update is part of the game. Compreender o pacote & sistema portuário e de quando e de que a atualização é parte do jogo.
For those who go for Fedora on servers, you might opt for ubuntu instead. Para aqueles que vão para o Fedora em servidores, você pode optar para Ubuntu vez. it’s easy and fast as well as free. É fácil e rápido, bem como livre.
May 10th, 2008 01:44 10 de maio de 2008 01:44
Lol, you should put this somewhere… Lol, você deve colocar esta algures…
Befor testing… REBOOT! Testes antes… reboot! XD
30 minutes lost trying to fix apache + php and all that was required was reboot ¬¬ 30 minutos perdeu a tentar corrigir apache + php e tudo o que foi exigido foi reiniciado ¬ ¬