Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 5 Установка веб-сервера в FreeBSD 6,0 с 2,2 Apache, MySQL 5,0 и PHP 5 - Часть 5
Installing Apache 2.2, MySQL 5 and PHP 5 in FreeBSD 6.0 for a Reliable Web Server Установка 2,2 Apache, MySQL 5 и PHP 5 в FreeBSD 6,0 за Надежные веб-сервера
Part 5 - Installing PHP Hypertext Preprocessor Scripting Language 5 and PHP 5 Extensions Часть 5 - Установка PHP Препроцессор Гипертекста Scripting Language 5 и PHP 5 Расширения
- Install by enter the following commands on FreeBSD OS command line, wait for previous command to finish before running the next command: Установить на введите следующие команды на ОС FreeBSD в командной строке, подождите предыдущей команды до конца перед запуском следующей команды:
cd /usr/ports/lang/php5 кд / usr/ports/lang/php5
make install clean сделать чистой установки - If you’re prompted, select “use Apache 2.x instead”. Если у Вас побудило, выберите "использовать Apache 2.x, вместо".
- Continue with the following commands to install PHP5 extensions and modules to enable the support of the modules in Apache: Продолжить следующие команды для установки PHP5 расширений и модулей, с тем чтобы поддержка модулей в Apache:
cd /usr/ports/lang/php5-extensions кд / usr/ports/lang/php5-extensions
make config сделать конфигурации - At Options for php5-extension 1.0 menu, select all PHP extensions and modules that you may use with Apache webserver. На Варианты php5-продление 1,0 меню выберите все расширений PHP и модулей, которые можно использовать с веб-сервером 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. Это является частью конфигурации для PHP, где нужно активировать функции PHP, которые приходят в модулях, таких, как способность управлять сессиями пользователей, интерфейс с базами данных и многие другие. Default extensions such as ctype functions support, HASH Message Digest Framework support, session support and etc have been selected. По умолчанию расширений, таких, как ctype функций поддержки, хэш Сообщение Digest Рамочной поддержка, поддержка сессии и т.д., были выбраны. Other popular extensions that you most likely to be in used are MySQL database support and GD library support. Другие популярных расширений, которые вам наиболее вероятно, будут использоваться в базе данных MySQL являются поддержка и поддержка библиотеки GD. Use space bar to select or unselect the extensions and press Enter when done. Использование космических бар, чтобы выбрать или отменить расширений и нажмите Войти когда они производятся.
- Continue the installation of php5-extensions with the following commands: Продолжить установку php5-расширений с следующие команды:
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. Если есть какие-либо сообщение появляется, и предложит вам выбрать несколько вариантов или конфигураций, вы можете просто согласиться с настройками по умолчанию, нажав Enter. Some modules that may prompt you for action include php5-gd, php5-mbstring and php5-sqlite. Некоторые модули, которые могут ввести меры включают php5-gd, php5-mbstring и php5-sqlite.
- Edit the Apache configuration file in order to enable Apache web server to load the PHP modules when initialization: Редактировать файл конфигурации Apache, с тем чтобы позволить веб-сервера Apache для загрузки модулей PHP при инициализации:
- Go to Apache configuration file location by cd /usr/local/etc/apache2/ Перейти в конфигурационном файле Apache место кд / usr/local/etc/apache2 /
- Edit Apache configuration file by vi httpd.conf Изменить Apache конфигурационный файл httpd.conf В.И.
- Search for LoadModule lines, after the last LoadModule line, but within the same section, add the following 2 lines: Поиск по LoadModule линий, после последней строки LoadModule, но в этом же разделе, добавить следующие 2 строки:
AddType application/x-httpd-php .php AddType применение / х-httpd-php. Php
AddType application/x-httpd-php-source .phps AddType применение / х-httpd-путь к источника. 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. При желании можно скопировать / usr / местные / и т.д. / php.ini-рекомендовано или / usr / местные / и т.д. / php.ini-расстояние в / usr / местные / и т.д. / php.ini (в одном каталоге), которая позволит вам настроить и изменить настройки по умолчанию поведение PHP.
- Start the Apache HTTP web server by using apachectl start (or restart Apache HTTP web server by using apachectl restart). Начать Apache HTTP веб-сервера с помощью apachectl начать (или перезагрузить Apache HTTP веб-сервера с помощью apachectl перезагрузки). apachectl is located in /usr/local/sbin, if you encounter Command not found problem, try to change directory to its location. apachectl находится в / usr / местные / sbin, если вы обнаружили командование не нашли проблему, попробуйте изменить каталог, чтобы о его местонахождении.
- PHP5 installation done. PHP5 установки сделать.
A web server has been setup with the FreeBSD with Apache, MySQL and PHP. Веб-сервер был установки с FreeBSD с Apache, MySQL и 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. Документ корень веб-сервера (там, где вы должны поместить ваши HTML и PHP файлов в / usr/local/www/apache22/data /, и вам потребуется SecureFTP (SFTP) клиенту, таких, как WinSCP для отправки файлов на веб-сервере надежно.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. ВАЖНО: Это машина переведена страница, на которой предоставляется "как есть" без гарантий. Machine translation may be difficult to understand. Машинный перевод может быть трудным для понимания. Please refer to Обратитесь к original English article Английский оригинал статьи whenever possible. когда это возможно.
Share and contribute or get technical support and help at Доля и вклад или получить техническую поддержку и помощь в My Digital Life Forums Моя Цифровая жизнь форумах .
Related Articles Статьи по теме
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4 Установка веб-сервера в FreeBSD 6,0 с 2,2 Apache, MySQL 5,0 и PHP 5 - Часть 4
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 Установка веб-сервера в FreeBSD 6,0 с 2,2 Apache, MySQL 5,0 и PHP 5 - Часть 3
- Easily Set Up Web Server with XAMPP Легко настроить веб-сервер с XAMPP
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 1 Установка веб-сервера в Windows XP с Apache2, PHP5 и MySQL4 - Часть 1
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 3 Установка веб-сервера в Windows XP с Apache2, PHP5 и MySQL4 - Часть 3
- FreeBSD Apache HTTP Accept Filter Error FreeBSD Apache HTTP согласиться с фильтром ошибке
- Using phpMyAdmin for Effective MySQL Management in Windows XP Использование phpMyAdmin MySQL для эффективного управления в Windows XP
- PHP 5 Unable to Open HTTP Request Stream with fopen or fsockopen Functions PHP 5 удалось открыть запрос HTTP, Stream с fopen или fsockopen Функции
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database Разрешить вырубку Slow запросов (Slow Запрос регистрации) в базе данных MySQL
- Enable MySQL InnoDB Storage Engine Support in XAMPP Installation Включить MySQL InnoDB хранения двигателя поддержка в установке XAMPP




























May 24th, 2006 10:23 24 мая 2006 10:23
Hi, I am trying to install, php5 with apache2.2 on freebsd 6.1. Привет, я пытаюсь установить, php5 с apache2.2 по freebsd 6,1. I have followed the instructions on this page. Я следовал инструкциям на этой странице. I can get apache running well, but php will not interpret any pages. Я могу получить apache работает хорошо, но php не будет интерпретировать любые страницы. 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. Я файла; info.php в ней, но когда я загрузить его из браузера он пытается скачать * * php файл не показать его. Furthermore, the httpd.conf does not have a entry to load the php module as a shared object. Кроме того, httpd.conf нет элемента, чтобы загрузить модуль как php разделяет объект. should it? должен ли? its as if apache has not idea how to process php’s. его как будто apache не идея, как обрабатывать php гг. Any guideance would be appreciated! Любое guideance будет оценен по достоинству!
kind regards уважением
May 24th, 2006 10:30 24 мая 2006 10:30
Did you add the followng lines to your httpd.conf? Вы followng добавить строки в ваш httpd.conf?
AddType application/x- httpd-php . Application/x- AddType httpd-php. php
AddType application/x- httpd-php-source . Application/x- AddType httpd-путь к источника. phps
Normally, ports installation will auto update the httpd.conf with php5 load module. Как правило, порты, установка будет автоматически обновлять httpd.conf с php5 загрузить модуль. Check if your httpd.conf has the following line, if not try to add: Проверьте, если ваш httpd.conf имеет следующие строки, если не пытаться добавить:
LoadModule php5_module libexec/apache22/libphp5.so LoadModule php5_module libexec/apache22/libphp5.so
May 24th, 2006 11:54 24 мая 2006 11:54
Yes, I certainly did add the AddType’s Да, я, конечно же добавить AddType в
the php5 port installation did not auto update httpd.conf with ‘LoadModule php5_module libexec/apache22/libphp5.so’. php5 установки порта не автоматическое обновление httpd.conf с 'LoadModule php5_module libexec/apache22/libphp5.so ". I would manually add it but the libphp5.so does not exist in the mentioned directory. Я хотел бы добавить его вручную, но libphp5.so не существует в упомянутых каталоге. Any idea’s? Любая идея в? I installed from the /usr/ports/lang/php5 port. Я установил с / usr/ports/lang/php5 порт. I heard using /usr/ports/www/mod_php5 port may work. Я слышал, используя / usr/ports/www/mod_php5 порт может работать. Would/should it make any difference? Будет / должно это делать какие-либо разница?
May 24th, 2006 16:01 24 мая 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. Привет Брюс, вы можете дать mod_php5 попробовать, но я думаю, вы потеряете некоторых функций, таких, как командной строки CLI. Or else try to make clean in php5 first. Или же попытаться сделать чистой php5 в первую очередь. Reinstalling from Apache again worth a try too. Переустановка с Apache снова стоит попробовать тоже. Note that you should install Apache first, and php5 will detect which version of Apache you’re running. Заметим, что вы должны установить Apache первых, php5 и определит, какая версия Apache у Вас установлена.
May 24th, 2006 16:11 24 мая 2006 16:11
Beside, make sure you updated to latest ports tree with Кроме того, убедитесь, что вы обновили последним деревом портов с portsnap or или cvsup .
May 29th, 2006 20:59 29 мая 2006 20:59
You might missed to install the php for apache, only cgi and cli. Вам может хватать для установки php для apache, только cgi и cli.
CD /usr/ports/php5 CD / usr/ports/php5
make config сделать конфигурации
then затем
make install clean сделать чистой установки
mayby you have to do mayby что вам нужно сделать
make deinstall && make reinstall deinstall и делать и делать повторно
June 4th, 2006 10:48 4 июня 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). Если добавить следующие строки в файл httpd.conf, не забудьте удалить лишние пробелы (есть 2 лишних пробелов в первоначальной статье, после doesnt't есть).
AddType application/x-httpd-php .php AddType применение / х-httpd-php. Php
AddType application/x-httpd-php-source .phps AddType применение / х-httpd-путь к источника. Phps
June 7th, 2006 05:21 7 июня 2006 05:21
I’m having the same problem as Bruce above. У меня аналогичная проблема, как Брюс выше. I’m using FreeBSD 6.1, Apache 2.2, and PHP 5.1.4. Я использую FreeBSD 6,1, 2,2 Apache и PHP 5.1.4. My ports tree is fresh and synched. Моя порты дерево свежим и synched.
I installed the PHP5 port with Apache module support. Я установил PHP5 порт с Apache модуль поддержки. The installation completes without complaining, but there is no Apache module built. Установки завершается без жалуюсь, но нет Apache модуль построен. The file /usr/local/libexec/apache22/libphp5.so does not exist. Файл / usr/local/libexec/apache22/libphp5.so не существует. It doesn’t exist anywhere else in the filesystem either. Она не существует нигде в файловой либо. Something is broken with this port. Нечто разбивается при этом порту. 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. Я вижу, исходные файлы в работе каталоги, как / usr/ports/lang/php5/work/php-5.1.4/sapi/apache, которые выглядят уместно этого модуля, но… не получают скомпилирована. Any insights? Любые выводы?
June 9th, 2006 20:41 9 июня 2006 20:41
Ahmet gave a working answer. Ахмет дал рабочий ответ. I was having the same problems, until I noticed the extra space before the file extention, now everything works like a charm! Я был с теми же проблемами, пока я не заметил, дополнительное пространство перед расширением файла, сейчас все работает как и шарм!
June 9th, 2006 20:59 9 июня 2006 20:59
Thanks for point out, has since corrected the error. Спасибо за то указать, с тех пор исправлены ошибки.
August 28th, 2006 10:55 28 августа 2006 10:55
Recompile php5 with ‘Apache Module’ included. Перекомпилируйте php5 с 'Apache модуль "включены.
‘cd /usr/ports/lang/php5′ "Кд / usr/ports/lang/php5"
‘make deinstall’ ignore warnings "Сделать deinstall" Игнорировать предупреждения
‘make config’ make sure to select apache module "Использовать конфигурации" не забудьте выбрать apache модуля
‘make install’ "Использовать установки '
September 26th, 2006 16:37 26 сентября 2006 16:37
I’ve Done it successfully. Мы сделали это успешно. It doesnt work.. Это не работа ..
How do i access it? Как я доступ к нему?
ive typed ive набрано http://192.168.1.9
November 29th, 2006 10:32 29 ноября 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. Если бы столкнуться с той же проблемой, как выше в лишние пробелы в AddType декларации, но решить ее до изучает замечания. Would recommend updating the article as, all in all, this is a great tutorial. Будет рекомендовать обновление статьи, как, в целом, это большой урок. Thanks. Спасибо.
Ben Бен
November 29th, 2006 12:35 29 ноября 2006 12:35
Thanks Ben, have since corrected the error. Спасибо Бен, с тех пор исправлены ошибки.
January 6th, 2007 16:50 6 января 2007 16:50
I’m running into the same issue. У меня работает в одну и ту же проблему. My php files are trying to download instead. Моя php файлы пытается загрузить вместо.
I’ve gone over everything three and four times yet nothing. Мы пошли на все три и четыре раза еще ничего.
I’ve checked the additional spaces as well and no luck. Я проверила дополнительных пространств, а не везения.
Any assistance is appreciated!! Любая помощь, это оценили!
January 9th, 2007 22:05 9 января 2007 года 22:05
I had same issue. Я же вопросу.
Try make config and unselect CGI and be sure to select APACHE. Попробуйте сделать конфигурации и отменить CGI и обязательно выберите Apache.
Check at end of install that you have a line like:chmod 755 /usr/local/libexec/apache22/libphp5.so Проверка на конец установить, что у вас вроде: ваш 755 / usr/local/libexec/apache22/libphp5.so
I config without CLI ang CGI. Я конфигурации без CLI анг CGI.
March 16th, 2007 08:28 16 марта 2007 08:28
Trying to install the package php5 without port sources via Попытка установить пакет php5 без источников, через порт
pkg_add -r php5 pkg_add-р php5
only this doesnt install the apache module by the looks of it.. только в этом doesn't установить apache модуле выглядит него ..
nor does it build it.. и не строить его ..
I dont want the sources on the server because it is to be a production server.. Я хочу dont источников на сервер, поскольку он должен производства сервере .. i’m gunna try a reinstall… Я gunna попробуйте переустановить…
March 16th, 2007 08:36 16 марта 2007 08:36
reinstall was unsuccessful снова оказалась безуспешной
April 18th, 2007 05:40 18 апреля 2007 05:40
I uninstalled, reinstalled making double sure to include the Apache model, still no dice. Я удалил, переустановлено сделать двойной Обязательно укажите модель Apache, до сих пор не игра в кости. 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. Поэтому я удалил все вновь и без повторной CLI и CGI, и он по-прежнему будет старте нет ошибок, но это будет список директорий в документе источник и будет обрабатывать cgi файлы, текстовые файлы. All my configs were in order, so I thought maybe it needed a reboot… and walah. Все мои конфиги были в порядке, поэтому я подумал, может быть, ей необходимо перезагрузить систему… и walah. Working like a charm. Работает так же как и очарование.
I think Unix is for massochists =) Я думаю, Unix предназначен для massochists =)
April 18th, 2007 05:42 18 апреля 2007 05:42
edit.. прав .. I meant ” .. Я имел в виду ".. would treat PHP files as text files ..” and not CGI. PHP будет обрабатывать файлы в виде текстовых файлов .. ", а не CGI.
Long day =0 Длинные день = 0
September 14th, 2007 17:03 14 сентября 2007 17:03
I’ve been trying to install Timetrex and it requires Apache, php and postgresql. Я пытался установить Timetrex и требует Apache, php и postgresql. Postgresql is not a problem because I install it from source. PostgreSQL, это не проблема, потому что я установить его на основе исходного кода. 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. Но, как видно из выше, порты FreeBSD системе настолько часто в состоянии потока, что вы ничего не гарантирует, что будет работать.
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. В этом вопросе хозяева, и я получил это подается с результатом FreeBSD, что мы установили Fedora, а затем принял продавцов установочный файл, который работает только с Linux и получил от с задачей.
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. Что так много зависимости и librairies обновить систему портов FreeBSD, как покинул меня чувство очень осторожно подходить, используя его и его harkens мне вернуться к старой M $ "dll - ад" дни, когда Windows 3x и Win9x были такие боли для рассмотрения .
November 30th, 2007 09:57 30 ноября 2007 09:57
This series of articles has been very, very helpful. Эта серия статей был очень, очень полезными. Many thanks for your contribution! Большое спасибо за Ваш вклад!
December 11th, 2007 20:53 11 Декабря 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. Если проблема с загружаемым sourcecodes существуют для кого-либо еще, если она была просто проблема, происходящих с локального, изменение прослушивания порта по умолчанию 80 до *: 80 может помочь. It is highly likely that in the above mentioned cases Apache had not much to do with serving the files on localhost. Весьма вероятно, что в вышеупомянутых случаях, Apache, не многое предстоит сделать с выступающей файлы на локальный.
Fedora does not have less dependancies, they are just handeld elswehere out of user eyes. Fedora не менее dependancies, они просто handeld elswehere из глаз пользователя.
Understanding the package & port system and when and why to update is part of the game. Понимание пакет порта и системы и, когда и почему для обновления является частью игры.
For those who go for Fedora on servers, you might opt for ubuntu instead. Для тех, которые пойти на Fedora на серверах, вы можете выбрать вместо убунту. it’s easy and fast as well as free. Это просто и быстро, а также бесплатно.
May 10th, 2008 01:44 10 мая 2008 01:44
Lol, you should put this somewhere… Ха-ха-ха, вы должны положить этому-то…
Befor testing… REBOOT! Befor испытания… REBOOT! XD
30 minutes lost trying to fix apache + php and all that was required was reboot ¬¬ 30 минут потерял пытается исправить apache + php и все, что требуется перезагрузка ¬ ¬