How to install PHP7 ports on FreeBSD 10.2

My friend ask me about FreeBSD PHP7 ports and he already check if the ports not exist yet. He just feel more comfortable with ports than using git or source.

I search Google and found github repository of PHP 7 ports. I give it a try with my vps and it looks good.

Lets get start!

# freebsd-update update
# freebsd-update install
# pkg update
# portsnap fetch
# portsnap extract

Install git

# pkg install -y git


# git clone
Cloning into ‘freebsd-php7-ports’…
remote: Counting objects: 210, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 210 (delta 16), reused 13 (delta 13), pack-reused 184
Receiving objects: 100% (210/210), 40.52 KiB | 0 bytes/s, done.
Resolving deltas: 100% (68/68), done.
Checking connectivity… done.

Copying all files

# mv /root/freebsd-php7-ports/ /usr/ports/Mk/


# mv /root/freebsd-php7-ports/lang/php7-extensions /usr/ports/lang/
# mv /root/freebsd-php7-ports/lang/php7-extensions /usr/ports/lang/


# cd /root/freebsd-php7-ports/archivers/
# mv php7-* /usr/ports/archivers/


# cd /root/freebsd-php7-ports/converters/
# mv php7-* /usr/ports/converters/


# cd /root/freebsd-php7-ports/databases/
# mv php7-* /usr/ports/databases/

Continue to others :-)

Install PHP7 ports

# cd /usr/ports/freebsd-php7-ports/lang/php7
# make install



# php -v
PHP 7.0.2 (cli) (built: Jan 30 2016 07:50:43) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

# php --ini
Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File: (none)
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed: (none)

Fix different date between PHP and CentOS server

Odd thing happen today when I see big difference between date from PHP output and date from shell.

PHP output :

22-12-2015 06:15:43

Shell output :

# date
Sel Des 22 13:19:54 WIB 2015

7 hour difference.

A few checklist for this case :

  1. Copy right timezone to localtime

# cp /usr/share/zoneinfo/Asia/Jakarta /etc/localtime

2.  Add right timezone to php.ini

#nano /usr/local/lib/php.ini

date.timezone = “Asia/Jakarta”

3. Check sysconfig clock

# nano /etc/sysconfig/clock

change Zone to “Asia/Jakarta”

4. Check for hardware clock aka hwclock

# hwclock
Sel 22 Des 2015 06:34:40 WIB -0.707297 seconds


How to install PHP 7 from source (tar.gz) with Apache on FreeBSD 10.2

Last post I’ve try install official PHP 7 (GA) but I then realized that I have PHP 7.1 ( I use default branch of PHP git source). A reader also shoot me an email ask for simple connection to web server. I’m glad to write that since time permit :-)

Here step by step guide install PHP 7.0 with Apache2 and MySQL 5.5 on FreeBSD 10.2

# pkg update
Updating FreeBSD repository catalogue…
Fetching meta.txz: 100% 940 B 0.9kB/s 00:01
Fetching packagesite.txz: 100% 5 MiB 251.3kB/s 00:22
Processing entries: 100%
FreeBSD repository update completed. 24605 packages processed.

# portsnap fetch
Looking up mirrors… none found.
Fetching public key from… done.
Fetching snapshot tag from… done.
Fetching snapshot metadata… done.
Fetching snapshot generated at Sat Dec 12 07:02:07 WIB 2015:
a69a8b66039839a497463d737a142cf72e71c993a4fda7100% of 70 MB 205 kBps 05m51s
Extracting snapshot… done.
Verifying snapshot integrity… done.
Fetching snapshot tag from… done.
Fetching snapshot metadata… done.
Updating from Sat Dec 12 07:02:07 WIB 2015 to Sat Dec 12 11:21:33 WIB 2015.
Fetching 4 metadata patches… done.
Applying metadata patches… done.
Fetching 0 metadata files… done.
Fetching 4 patches.
(4/4) 100.00% done.
Applying patches…
Fetching 0 new ports or files… done.

Why reinvent the wheel if php7 ports for FreeBSD available. read more »

How to fix freebsd-update no mirror problem

In my latest post about php 7 on FreeBSD 10.2 I use $5 vps/month as quick solution for my freebsd 10.2 need (the service is really good actually since I can use any *bsd by upload iso to their server). The main problem of it is freebsd-update problem where I face this error when I use freebsd-update : “No mirrors remaining, giving up”.

I don’t see that problem when I use vps but I used to see it when I try to use virtualization like virtualbox but I need it for my class. Each student must be able to update their freebsd box by their self.

Finally I got the solution 5 minutes before class start :-)


Here’s what I do :

1st try

# freebsd-update fetch
Looking up mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from…

No mirrors remaining, giving up.

Try to debug it

# freebsd-update -v debug fetch
Looking up mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from…
fetch: transfer timed out
fetch: latest.ssl appears to be truncated: 0/512 bytes
No mirrors remaining, giving up.

Ok, lets try other mirror

# freebsd-update -s fetch
Looking up mirrors… none found.
Fetching metadata signature for 10.2-RELEASE from… ^C^C

I cancel it.

Another try

# dig read more »

How to Enable Designer Tab on PhpMyAdmin

I’m in the middle of project deadline and need to create simple erd. I ever see designer tab in phpmyadmin long time ago but when I need it today I see nothing.


To enable the designer tab  :

  1. Edit

In case only available then you need to rename the file into

Locate these lines :


* phpMyAdmin configuration storage settings.

/* User used to manipulate with storage */
// $cfg[‘Servers’][$i][‘controlhost’] = ”;
// $cfg[‘Servers’][$i][‘controlport’] = ”;
$cfg[‘Servers’][$i][‘controluser’] = ‘pma’;
$cfg[‘Servers’][$i][‘controlpass’] = ‘pmapass’;

/* Storage database and tables */
$cfg[‘Servers’][$i][‘pmadb’] = ‘phpmyadmin’;
$cfg[‘Servers’][$i][‘bookmarktable’] = ‘pma__bookmark’;
$cfg[‘Servers’][$i][‘relation’] = ‘pma__relation’;
$cfg[‘Servers’][$i][‘table_info’] = ‘pma__table_info’;
$cfg[‘Servers’][$i][‘table_coords’] = ‘pma__table_coords’;
$cfg[‘Servers’][$i][‘pdf_pages’] = ‘pma__pdf_pages’;
$cfg[‘Servers’][$i][‘column_info’] = ‘pma__column_info’;
$cfg[‘Servers’][$i][‘history’] = ‘pma__history’;
$cfg[‘Servers’][$i][‘table_uiprefs’] = ‘pma__table_uiprefs’;
$cfg[‘Servers’][$i][‘tracking’] = ‘pma__tracking’;
$cfg[‘Servers’][$i][‘designer_coords’] = ‘pma__designer_coords’;
$cfg[‘Servers’][$i][‘userconfig’] = ‘pma__userconfig’;
$cfg[‘Servers’][$i][‘recent’] = ‘pma__recent’;
$cfg[‘Servers’][$i][‘users’] = ‘pma__users’;
$cfg[‘Servers’][$i][‘usergroups’] = ‘pma__usergroups’;

Make sure to remove // in front of the lines.

2. Grant user pma ; you can use phpmyadmin ‘SQL’ .

GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO ‘pma’@’localhost’ identified by ‘pmapass’ with GRANT OPTION;

3. Import SQL from examples directory of your phpmyadmin. read more »