Install Apache, MySQL And PHP On FreeBSD9
In this tutorial i will show you how to install AMP(Apache, MySQL, PHP ) in FreeBSD9.
Installing AMP in FreeBSD
# uname -a FreeBSD Freebsd-unixmen 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243826: Tue Dec 4 06:55:39 UTC 2012 firstname.lastname@example.org:/usr/obj/usr/src/sys/GENERIC i386
cd /usr/ports/www/apache24 make install clean
Once Apache has been successfully installed, add the following line to /etc/rc.conf so that Apache will start automatically at system boot.
echo 'apache24_enable="YES"' >> /etc/rc.conf
Start Apache service.
# /usr/local/etc/rc.d/apache24 start Performing sanity check on apache22 configuration: Syntax OK Starting apache24.
cd /usr/ports/databases/mysql56-server make install clean
2-1. Open /etc/rc.conf with your editor and add the line shown below to enable starting mysql server on boot.
2-2. Start mysql manually.
/usr/local/etc/rc.d/mysql-server start Starting mysql.
2-3. Set a password for the MySQL root user and login by executing the command
# mysqladmin -u root password "my-password" # mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.13 Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
we have to install php55 and his extensions
cd /usr/ports/lang/php55 make config
LoadModule php5_module libexec/apache24/libphp5.so
make install clean
check the installed php version:
php --version PHP 5.5.0 (cli) (built: Aug 12 2013 15:30:36) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0-dev, Copyright (c) 1998-2013 Zend Technologies
Install now php55-extensions
cd /usr/ports/lang/php5-extensions/ make config
Please select “MySQL database support” and “MySQLi database support”, if you want later connect to Mysql databases.
make install clean
Configure PHP with Apache
cp /usr/local/etc/php.ini-development /usr/local/etc/php.ini
Edit /usr/local/etc/apache24/httpd.conf and find DirectoryIndex index.html, then add index.php:
DirectoryIndex index.html index.htm index.php
add the following lines too:
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
Check if php is installed well via phpinfo file.
Add the following lines.
<?php phpinfo(); ?>
echo "<? phpinfo(); ?>" >> /usr/local/www/apache24/data/test.php
save and exit.
Like us on Facebook
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- Twelve Vulnerabilities Have Been Fixed In Ubuntu 12.04, Time To Update : Canonical has released security updates for Ubuntu 12.04 LTS and advices to update your system as so...0 comments |
- TeamViewer 9 Final Has Been Released! : TeamViewer is a commercial all-in-one software that can be used for remote control, desktop sharing,...0 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Configure Your Browser To Use Tor On Ubuntu/Debian/Linux Mint : Tor, The Onion Router, is a network of Virtual Tunnels that allows users to communicate securely and...1 comment |
- Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...0 comments |
- TeamViewer 9 Final Has Been Released!
- Twelve Vulnerabilities Have Been Fixed In Ubuntu 12.04, Time To Update
- OpenLDAP Installation and Configuration in Ubuntu 12.10/13.04/13.10 And Debian 6/7
- Configure Your Browser To Use Tor On Ubuntu/Debian/Linux Mint
- Setup A Full Featured ITIL Management System Using Integria IMS On CentOS 6
- Install LibreOffice 4.1.3 in Elementary OS ‘Luna’
- How To Install Simple Scan in Crunchbang ‘Waldorf’
- Selene Media Encoder: Convert Audio, Video Files To Most Popular Formats
- Linux Kernel 3.12.2 Is Available For Download! Install / Upgrade Instructions
- CentOS 6.5 Has Been Officially Released!
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .