pkg: PACKAGESITE in pkg.conf is no longer supported.

As FreeBSD 10.1 spoil me with pkg then I stumble upon FreeBSD 9.2 box that installed due to its default ports. Yes another requirement of PHP 5.2.17 in the house yo.

The problem I encounter is :

# pkg info
pkg: PACKAGESITE in pkg.conf is no longer supported. Convert to the new repository style. See pkg.conf(5)
pkg: Cannot parse configuration file!

I guess that error lead to error problem when compile PHP 5.2.17 from ports.



Make sure index.php is part of your DirectoryIndex.

You should add the following to your Apache configuration file:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

====> Compressing man pages (compress-man)
===> Building package for php52-5.2.17_14
Creating package /usr/ports/lang/php52/work/pkg/php52-5.2.17_14.tbz
Registering depends: apache22-2.2.27_2 apr- gdbm-1.11 gettext- libxml2-2.8.0_5 libiconv-1.14_3 db48- pcre-8.34 perl5-5.16.3_9 expat-2.1.0.
Registering conflicts: php53-5* php5-5*.
Creating bzip’d tar ball in ‘/usr/ports/lang/php52/work/pkg/php52-5.2.17_14.tbz’
tar: bin/php: Cannot stat: No such file or directory
tar: bin/php-config: Cannot stat: No such file or directory
tar: bin/phpize: Cannot stat: No such file or directory
tar: etc/php.conf: Cannot stat: No such file or directory
tar: etc/php.ini-dist: Cannot stat: No such file or directory
tar: etc/php.ini-recommended: Cannot stat: No such file or directory
tar: include/php/TSRM/TSRM.h: Cannot stat: No such file or directory
tar: include/php/TSRM/acconfig.h: Cannot stat: No such file or directory
tar: include/php/TSRM/readdir.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_config.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_config.w32.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_config_common.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_nw.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_strtok_r.h: Cannot stat: No such file or directory
tar: include/php/TSRM/tsrm_virtual_cwd.h: Cannot stat: No such file or directory


# ls /usr/local/etc/ | grep pkg

Replace pkg.conf

# mv /usr/local/etc/pkg.conf.sample /usr/local/etc/pkg.conf

# pkg info
pkg-1.4.6 Package manager

NO error this time.

# echo ‘NO_WARNING_PKG_INSTALL_EOL=yes’ >> /etc/make.conf

pkg update
Updating FreeBSD repository catalogue…
pkg: Repository FreeBSD has a wrong packagesite, need to re-create database
Fetching meta.txz: 100% 968 B 1.0k/s 00:01
Fetching packagesite.txz: 100% 5 MB 230.6k/s 00:23
Processing entries: 100%
FreeBSD repository update completed. 23846 packages processed

Re try compile but not work but at least “pkg: PACKAGESITE in pkg.conf is no longer supported.’ no longer appear.

Install Drupal 8 with phpng (php next generation) on FreeBSD 10.1

After get success with php next generation (phpng) installation I decide to test it with real php script. Drupal came to my attention and I came with a plan of recipe 🙂

  • Drupal 8 (at the moment its 8.0.0-beta4)
  • PHP 7.0.0-dev
  • Lighttpd
  • MariaDB 10

I still use Vultr as Vps provider since my adsl connection is sucks at the moment.

Lets get start

Install MariaDB 10

I use pkg approach than using source way that I did before.

Delete previous installed mysql client

# pkg info | grep mysql
mysql56-client-5.6.22 Multithreaded SQL database (client)
# pkg delete mysql56-client
Checking integrity… done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:

The operation will free 45 MB.

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling mysql56-client-5.6.22…
[1/1] Deleting files for mysql56-client-5.6.22: 100%

Install MariaDB 10 server and Client

# pkg install -y mariadb100-server mariadb100-client

Enable MariaDB from rc.conf

# echo 'mysql_enable=YES' >> /etc/rc.conf

Start MariaDB Service

# /usr/local/etc/rc.d/mysql-server start

Change MariaDB root password

# /usr/local/bin/mysql_secure_installation


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!

Add new user for upcoming drupal installation

# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.0.15-MariaDB FreeBSD Ports

Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> create database drupal;
Query OK, 1 row affected (0.00 sec)

MariaDB [mysql]> grant all privileges on drupal.* to [email protected] identified by ‘123456’ with grant option;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.01 sec)

MariaDB [mysql]> exit

Compile phpng

I compile phpng using last post.

# mkdir $HOME/tmp/usr/etc

# /root/tmp/usr/etc/php.ini

add these lines


Install Lighttpd

# pkg install -y lighttpd
Updating FreeBSD repository catalogue…
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 2 packages will be affected (of 0 checked):

New packages to be INSTALLED:
lighttpd: 1.4.35_5
pcre: 8.35_2

The process will require 6 MB more space.
1 MB to be downloaded.
Fetching lighttpd-1.4.35_5.txz: 100% 215 KB 219.8k/s 00:01
Fetching pcre-8.35_2.txz: 100% 1 MB 1.1M/s 00:01
Checking integrity… done (0 conflicting)
[1/2] Installing pcre-8.35_2…
[1/2] Extracting pcre-8.35_2: 100%
[2/2] Installing lighttpd-1.4.35_5…
[2/2] Extracting lighttpd-1.4.35_5: 100%

Set Lighttpd run on boot

# echo 'lighttpd_enable=YES' >> /etc/rc.conf

Create document root

# mkdir -p /usr/local/www/data

# touch /usr/local/www/data/index.html

# echo 'tes' > /usr/local/www/data/index.html

Lighttpd Configuration


# ee /usr/local/etc/lighttpd/modules.conf

remove # sign in front of this line:

## FastCGI (mod_fastcgi)
include “conf.d/fastcgi.conf”

save the file.

# ee /usr/local/etc/lighttpd/conf.d/fastcgi.conf

Add these lines under “server.modules += ( “mod_fastcgi” ) ” : source.

fastcgi.server = ( “.php” => ((
“bin-path” => “/root/tmp/usr/bin/php-cgi”,
“socket” => “/tmp/php.socket”,
“max-procs” => 2,
“bin-environment” => (
“bin-copy-environment” => (
“broken-scriptfilename” => “enable”

Enable fastcgi

Make sure output of

# /root/tmp/usr/bin/php-cgi -v

PHP 7.0.0-dev (cgi-fcgi) (built: Jan 23 2015 04:55:05)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.8.0-dev, Copyright (c) 1998-2014 Zend Technologies

cgi-fcgi means fast cgi enabled.

Testing phpinfo()

# echo "<?php phpinfo();?>" > /usr/local/www/data/info.php

See it from browser.



Fix Lighttpd error message

(network.c.283) warning: please use server.use-ipv6 only for hostnames, not without server.bind / empty address; your config will break if the kernel default for IPV6_V6ONLY changes

That message show up when lighttpd restart.


Install Drupal 8

I’ll continue it next time 🙂

How to install phpng aka php7 on FreeBSD 10

FreeBSD Mug

Update : I already try official PHP 7 and wrote it here (using git) and there (using tar.gz file)

FreeBSD Mug by wsinetworks

I just curious about php next generation aka phpng aka php7 . After a few times fail with hhvm ( FreeBSD hhvm and DragonFlyBSD hhvm) I think I need to test something different for my lab experiment 🙂

The choice came to phpng and with the help from Vultr I can cure my curiosity in fast deployment. Well,

I use this configuration :

VPS location : Germany (Frankfurt), Europe.


FreeBSD version : FreeBSD 10 64 bit


Specs : 1 cpu, 768 MB memory, 15 GB storage and 1000 GB transfer.


Great, Hit ‘Place Order’ button and I can test it.

Steps :

Most of step taken from wiki of phpng.

1. Log in to server using ssh


Continue reading

Rebuild Fedora as Server using VPS and custom iso

Today task is little different. Old php script that run on PHP 5.2.9 and utilize mysql 5.0.88 need to rebuild in other place. That way another group of developer can add or inspect why new injected code can behave odd in such environment (they already try new code using newer PHP and it work well).

As far I can see from server log in message its Fedora 10 and using old PHP and old Mysql version. I need to replicate it in some place. Where we (I and developer) can log in and see it together.

Target for this server is same php and same mysql version :

#rpm -qa | grep php


# rpm -qa | grep mysql


VPS is my option  and Vultr (I choose $5/month specs that come with 15GB SSD storage and 768MB memory) can help me for this case .

Log in to Vultr and upload iso

  1. For Fedora 10 64 bit click here.
  2. For Fedora 10 32 bit click here.

Since I need to replicate it with minimum hassle I decide to use 64 bit in DVD format.

Create Server

After iso file successfully uploaded then I Choose custom iso selected Fedora 10 file.

fedora10_vps : virtual iso

After hit ‘deploy server’ wait for moment to take control.

Install Fedora Server in VPS

In case you see ipxe message in ‘console’ then you must make sure iso file attached. Check from virtual iso menu. If it’s not then select Fedora images and click ‘attach iso and reboot’ button.

fedora10_vps2 : attach iso


This view is the right one.

fedora10_vps3 : remove attached iso

Go back to manage server menu and choose ‘console’ link. If you see this then iso attach process working well.

fedora10_vps4 : install serverThe rest of installation step is as usual.

For partition I choose to use all disk space.

fedora10_server5 : web server chosen etcWeb server and repositories (installation repo, Fedora 10 -x86_64 and updates).

Reboot and configure it for first time as usual till you see this view (already login)

fedora10_vps6 : successfully installed

Disable GUI login and X-Window on Fedora

Yes, of course its server. No X windows please 🙂

Open terminal from console and edit /etc/inittab and change this line :





In this stage also make sure to remove iso from custom iso menu for this server.

After server reboot you’ll see no more X-Window.


Control Fedora Server using ssh

By default ssh server already installed and running. Vultr system will make sure right ip assigned for this VPS and you just need to access it from ipv4 provided.



free -m

# free -m
total used free shared buffers cached
Mem: 748 169 578 0 6 57
-/+ buffers/cache: 105 642
Swap: 1503 0 1503

# df -H
Filesystem Size Used Avail Use% Mounted on
15G 3,4G 10G 26% /
/dev/vda1 200M 15M 175M 8% /boot
tmpfs 393M 0 393M 0% /dev/shm

Check PHP

# rpm -qa | grep php


Check MySQL

# rpm -qa | grep mysql


I can see the result is different. I use 64 bit while existing server use 32 bit and few extension not installed. In general Vultr can help me rebuild the server. I just need to more careful and diligent 🙂

# yum install php-gd php-mcrypt php-mbstring php-pecl-apc mysql-server

For iptables etc remain same as Install PHP 5.2.17 on CentOS 5.10.

For Selinux case I prefer to disable it :

# nano /etc/selinux/config

change enforcing to disabled .


Compile HHVM 3.4 on DragonFlyBSD 4

My last experiment with HHVM is testing compile it with HHVM LTS (its version 3.3) on FreeBSD 10. Since HHVM 3.4 is out I think I’ll try it again with FreeBSD 10 but since I just install DragonFlyBSD 4 then I think I’ll give it try.

Another reason is I just curious to see implementation of DragonFlyBSD in many field. By share it to others perhaps I can contribute too.

Ok, lets go back to topic.

I use DragonFlyBSD 4 that I install recently. It has 2 cpu and memory 2GB plus hammer filesystem enabled.

See current installed package

# pkg info
bind-tools-9.10.1_3 BIND DNS suite with updated DNSSEC and DNS64
ca_root_nss-3.17.2_1 The root certificate bundle from the Mozilla Project
cdrtools-3.00_2 CD/DVD/BluRay and ISO-9660 image creation and extraction tools
curl-7.38.0_2 Non-interactive tool to get files from FTP, GOPHER, HTTP(S) servers
cvsps-2.1_1 Create patchset information from CVS
expat-2.1.0_1 XML 1.0 parser written in C
gettext- GNU gettext package
git-2.1.2 Distributed source code management tool
idnkit-1.0_5 Library to handle internationalized domain names
indexinfo-0.2 Utility to regenerate the GNU info page index
isc-dhcp42-server-4.2.7 The ISC Dynamic Host Configuration Protocol server
libxml2-2.9.2_2 XML parser library for GNOME
openssl-1.0.1_16 SSL and crypto library
pkg-1.3.8_3 Package manager

Continue reading