<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Install php7 in FreeBSD Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/install-php7-in-freebsd/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 10 Dec 2018 19:46:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How to Install Apache PHP7 and MariaDB on FreeBSD12</title>
		<link>https://www.osradar.com/how-toinstall-apache-php7-and-mariadbon-freebsd12/</link>
					<comments>https://www.osradar.com/how-toinstall-apache-php7-and-mariadbon-freebsd12/#respond</comments>
		
		<dc:creator><![CDATA[Mel]]></dc:creator>
		<pubDate>Mon, 10 Dec 2018 19:43:25 +0000</pubDate>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[FAMP in FreebSD 12]]></category>
		<category><![CDATA[Install php7 in FreeBSD]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=8216</guid>

					<description><![CDATA[<p>Some People are  calling this FAMP because its related to install  Apache PHP and Mysql on  Freebsd instead of Linux.  let me guide you in this  installation of FAMP on my   local FreeBSD 12 just  released today . My FreeBSD have IP 192.168.65.162 First  Updates all your FreeBSD  ports portsnap fetch update portsnap extract portsnap [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-toinstall-apache-php7-and-mariadbon-freebsd12/">How to Install Apache PHP7 and MariaDB on FreeBSD12</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Some People are  calling this FAMP because its related to install  Apache PHP and Mysql on  Freebsd instead of Linux.  let me guide you in this  installation of FAMP on my   local FreeBSD 12 just  released today .</p>
<p>My FreeBSD have IP 192.168.65.162</p>
<p>First  Updates all your FreeBSD  ports</p>
<pre class="">portsnap fetch update
portsnap extract
portsnap update</pre>
<p><img loading="lazy" class="alignnone size-full wp-image-8223" src="https://www.osradar.com/wp-content/uploads/2018/12/FreeBSD11.png" alt="" width="950" height="582" srcset="https://www.osradar.com/wp-content/uploads/2018/12/FreeBSD11.png 950w, https://www.osradar.com/wp-content/uploads/2018/12/FreeBSD11-300x184.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/FreeBSD11-768x471.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/FreeBSD11-686x420.png 686w" sizes="(max-width: 950px) 100vw, 950px" /></p>
<h3><strong>1-Install apache  on FreeBSD12</strong></h3>
<p>the package installer of FreeBSD is  pkg</p>
<p>install  with this  comand</p>
<pre class="">pkg  install apache24</pre>
<p><img loading="lazy" class="alignnone size-full wp-image-8222" src="https://www.osradar.com/wp-content/uploads/2018/12/freeBSD-apache2.png" alt="" width="933" height="580" srcset="https://www.osradar.com/wp-content/uploads/2018/12/freeBSD-apache2.png 933w, https://www.osradar.com/wp-content/uploads/2018/12/freeBSD-apache2-300x186.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/freeBSD-apache2-768x477.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/freeBSD-apache2-676x420.png 676w" sizes="(max-width: 933px) 100vw, 933px" /></p>
<p>enable the daemon system-wide in FreeBSD.</p>
<p><img loading="lazy" class="alignnone size-full wp-image-8221" src="https://www.osradar.com/wp-content/uploads/2018/12/rc-apache.png" alt="" width="667" height="70" srcset="https://www.osradar.com/wp-content/uploads/2018/12/rc-apache.png 667w, https://www.osradar.com/wp-content/uploads/2018/12/rc-apache-300x31.png 300w" sizes="(max-width: 667px) 100vw, 667px" /></p>
<p><strong>Start Apache</strong></p>
<pre class="">#service apache24 start</pre>
<p><strong>Check  the status </strong></p>
<pre class="">#service apache24  status</pre>
<p>Apche24 root Directory is /usr/local/www/apache24/data you can edit the index.html to anything you want like my example bellow.</p>
<p>Please browse to the host : http://ip or http://fqdn</p>
<p><img loading="lazy" class="alignnone size-full wp-image-8226" src="https://www.osradar.com/wp-content/uploads/2018/12/apache.png" alt="" width="1385" height="523" srcset="https://www.osradar.com/wp-content/uploads/2018/12/apache.png 1385w, https://www.osradar.com/wp-content/uploads/2018/12/apache-300x113.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/apache-768x290.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/apache-1024x387.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/apache-1068x403.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/apache-1112x420.png 1112w" sizes="(max-width: 1385px) 100vw, 1385px" /></p>
<h3><strong>2-Install PHP7 on FreeBSD12</strong></h3>
<p>you have two ways to install PHP7</p>
<p>Install php 7 via  Ports</p>
<pre class="">ls /usr/ports/lang/ | grep php
cd /usr/ports/lan/php73
make install clean</pre>
<p><img loading="lazy" class="alignnone size-full wp-image-8229" src="https://www.osradar.com/wp-content/uploads/2018/12/php-FreebSD.png" alt="" width="903" height="289" srcset="https://www.osradar.com/wp-content/uploads/2018/12/php-FreebSD.png 903w, https://www.osradar.com/wp-content/uploads/2018/12/php-FreebSD-300x96.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/php-FreebSD-768x246.png 768w" sizes="(max-width: 903px) 100vw, 903px" /></p>
<p>Also do the same for the  php extensions  but to avoid any dependencies issues i will advice to install php from the pkg manager</p>
<p><strong>install php7 via package manager on FreeBSD 12  </strong></p>
<p>Find latest php7  release from FreeBSD repositories</p>
<p>seach for the latest release from repo. for now is php72  is the latest release i think  php73 will be sonn pushed to the repo</p>
<pre class="">pkg search  php72</pre>
<p>Install  php72  and some  needed  pjp  modules  on FreeBSD 12</p>
<pre class="">pkg install php72 mod_php72 php72-mbstring php71-mcrypt php72-zlib php72-curl php72-gd php72-json</pre>
<p>you see i&#8217;m using php71-mycript because the version 72  is not yet released  till today</p>
<p>to make php  working with apache we need extra php file configuration  (/usr/local/etc/apache24/Includes/php.conf)  with  this  content</p>
<pre class="">&lt;IfModule dir_module&gt;
DirectoryIndex index.php index.html
&lt;FilesMatch "\.php$"&gt;
SetHandler application/x-httpd-php
&lt;/FilesMatch&gt;
&lt;FilesMatch "\.phps$"&gt;
SetHandler application/x-httpd-php-source
&lt;/FilesMatch&gt;
&lt;/IfModule&gt;</pre>
<p><img loading="lazy" class="alignnone size-full wp-image-8235" src="https://www.osradar.com/wp-content/uploads/2018/12/include.png" alt="" width="1058" height="321" srcset="https://www.osradar.com/wp-content/uploads/2018/12/include.png 1058w, https://www.osradar.com/wp-content/uploads/2018/12/include-300x91.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/include-768x233.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/include-1024x311.png 1024w" sizes="(max-width: 1058px) 100vw, 1058px" /></p>
<p>How to test the PHP configuration.</p>
<p>Please do the  follow  command</p>
<pre class="">echo '&lt;?php phpinfo();  ?&gt;' | tee -a /usr/local/www/apache24/data/info.php</pre>
<p>Now restart  apache  and  checlk  http://ip/info.php</p>
<pre class="">service apache24 restart</pre>
<p>&nbsp;</p>
<p><img loading="lazy" class="alignnone size-full wp-image-8238" src="https://www.osradar.com/wp-content/uploads/2018/12/phpinfo.png" alt="" width="1460" height="892" srcset="https://www.osradar.com/wp-content/uploads/2018/12/phpinfo.png 1460w, https://www.osradar.com/wp-content/uploads/2018/12/phpinfo-300x183.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/phpinfo-768x469.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/phpinfo-1024x626.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/phpinfo-1068x653.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/phpinfo-687x420.png 687w" sizes="(max-width: 1460px) 100vw, 1460px" /></p>
<p>Looks good 🙂</p>
<h3><strong>3-Install MariaDB on FreeBSD12</strong></h3>
<p>Now we will continue using the binary package method</p>
<pre class="">root@:/usr/local/www/apache24/data # pkg search mariadb
mariadb-connector-c-3.0.6 MariaDB database connector for C
mariadb-connector-odbc-3.0.3 MariaDB database connector for odbc
mariadb102-client-10.2.19 Multithreaded SQL database (client)
mariadb102-server-10.2.19 Multithreaded SQL database (server)
mariadb103-client-10.3.11 Multithreaded SQL database (client)
mariadb103-server-10.3.11 Multithreaded SQL database (server)
root@:/usr/local/www/apache24/data #</pre>
<p><strong>Install Mariadb server and client</strong></p>
<p>pkg install mariadb103-server-10.3.11 mariadb103-client-10.3.11 php72-mysqli1 php72-mysqli</p>
<p><img loading="lazy" class="alignnone size-full wp-image-8240" src="https://www.osradar.com/wp-content/uploads/2018/12/mariadb.png" alt="" width="1228" height="551" srcset="https://www.osradar.com/wp-content/uploads/2018/12/mariadb.png 1228w, https://www.osradar.com/wp-content/uploads/2018/12/mariadb-300x135.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/mariadb-768x345.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/mariadb-1024x459.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/mariadb-1068x479.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/mariadb-936x420.png 936w" sizes="(max-width: 1228px) 100vw, 1228px" /></p>
<p>Enable MariaDB server system-wide and start the database daemon</p>
<pre class=""># sysrc mysql_enable="yes" 
# service mysql-server start</pre>
<p><strong>Configure and set root  mysql password </strong></p>
<pre class="">root@:/usr/local/www/apache24/data # /usr/local/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!</pre>
<p><img loading="lazy" class="alignnone size-full wp-image-8243" src="https://www.osradar.com/wp-content/uploads/2018/12/secure_musql.png" alt="" width="1152" height="828" srcset="https://www.osradar.com/wp-content/uploads/2018/12/secure_musql.png 1152w, https://www.osradar.com/wp-content/uploads/2018/12/secure_musql-300x216.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/secure_musql-768x552.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/secure_musql-1024x736.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/secure_musql-1068x768.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/secure_musql-584x420.png 584w" sizes="(max-width: 1152px) 100vw, 1152px" /></p>
<p>You are  Done.</p>
<p>Please  login to see if your root password is working.</p>
<pre class="">mysql -u root -p</pre>
<p><img loading="lazy" class="alignnone size-full wp-image-8245" src="https://www.osradar.com/wp-content/uploads/2018/12/mysqllogin.png" alt="" width="1141" height="529" srcset="https://www.osradar.com/wp-content/uploads/2018/12/mysqllogin.png 1141w, https://www.osradar.com/wp-content/uploads/2018/12/mysqllogin-300x139.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/mysqllogin-768x356.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/mysqllogin-1024x475.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/mysqllogin-1068x495.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/mysqllogin-906x420.png 906w" sizes="(max-width: 1141px) 100vw, 1141px" /></p>
<p><strong>Sockstat command</strong></p>
<p>This Sockstat will show you  all  connection listening  on Ipv4</p>
<p><img loading="lazy" class="alignnone size-full wp-image-8247" src="https://www.osradar.com/wp-content/uploads/2018/12/Sockets.png" alt="" width="1085" height="500" srcset="https://www.osradar.com/wp-content/uploads/2018/12/Sockets.png 1085w, https://www.osradar.com/wp-content/uploads/2018/12/Sockets-300x138.png 300w, https://www.osradar.com/wp-content/uploads/2018/12/Sockets-768x354.png 768w, https://www.osradar.com/wp-content/uploads/2018/12/Sockets-1024x472.png 1024w, https://www.osradar.com/wp-content/uploads/2018/12/Sockets-1068x492.png 1068w, https://www.osradar.com/wp-content/uploads/2018/12/Sockets-911x420.png 911w" sizes="(max-width: 1085px) 100vw, 1085px" /></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-toinstall-apache-php7-and-mariadbon-freebsd12/">How to Install Apache PHP7 and MariaDB on FreeBSD12</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-toinstall-apache-php7-and-mariadbon-freebsd12/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
