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
We need your assistance to stay live
This week Top Posts
- Wow! Linux Foundation To Offer Free Linux Course This Summer Worth $2,400 on EdX : Wow! Early last week it was all over the internet, if you haven't heard it yet then this is the t...0 comments |
- Grive: An Unofficial, Open Source Linux Client For Google Drive : A couple of months before, we have featured a Linux client for Google Drive named Syncdrive, which w...1 comment |
- 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 |
- How To "Fix E: Could not open file /var/lib/dpkg/status" : QUESTION: I get the following error when I use sudo apt-get update: E: Could not open file /var/...0 comments |
- Install Sublime Text 3 In Fedora Easily With Fedy : Sublime Text is a sophisticated text editor for code, markup and prose. In this tutorial we are goi...0 comments |
- Install nSnake Game In Terminal : From github repo nsnake is a clone of the classic snake game that we all used to play on our cellp...0 comments |
- Install Sublime Text 3 In Fedora Easily With Fedy
- Grive: An Unofficial, Open Source Linux Client For Google Drive
- Install nSnake Game In Terminal
- How To “Fix E: Could not open file /var/lib/dpkg/status”
- Wow! Linux Foundation To Offer Free Linux Course This Summer Worth $2,400 on EdX
- Fedora 21 Scheduled For Release In October
- Install Uget Download Manager In Ubuntu, Fedora, Debian
- Download Elementary OS ‘Luna’ Official Wallpapers
- Install Power Commands 0.1.5 On Ubuntu 14.04/13.10/12.10/12.04
- 5 Android Apps that’s Going to Make Running Your Business Less Stressful
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .