Currently Viewing Posts Tagged extension

USB Front Panel for PC

My PC case has a front panel. Including two USB 2.0 ports, one MIC port, and one earphone port. It is not enough. It is not fast enough.
The motherboard Gigabyte B450M DS3H has F_USB30 and F_USB1 and F_USB2.

I can get a USB front panel and connect it to the motherboard. Then I can use the USB 3.0 and 2.0 together front the front easily.
Let’s have a look at some pictures.

B450M DS3H top view

 

Hard to find the ports. Look at the manual below.

Motherboard USB

 

Continue reading “USB Front Panel for PC”

php-fpm can not use html as php

I have a site, which use nginx as web server and php-fpm as php interpreter. Most of the files use html extension name.

My nginx conf file has following section.

location ~ \.html|php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

But, when I enter the url such as https://example.com/sample.html, whose content is php script. It did not work.

The solution is to change the config of php.

SSH to the VPS.
Edit /etc/php/7.1/fpm/pool.d/www.conf
Find the security.limit_extensions and uncomment it, add html at the end.

security.limit_extensions = .php .php3 .php4 .php5 .php7 .html

After it, reload nginx, all done.

The simple way to install the dbase extension on php7.0

Here is the simple way to install the dbase extension. One command only.

 

sudo pecl install dbase-7.0.0beta1

It will install the extension for you. You just need to restart php7.0-fpm service.

Check the php information.

If your php is version 5 to 5.7. Change the command to

sudo pecl install dbase

Go to php.net and look at the introduction of dBase section.

This extension has been moved to the PECL repository and is no longer bundled with PHP as of PHP 5.3.0.

That’s why we have to install this extension from pecl installation.

https://pecl.php.net/package/dbase

https://php.net/manual/en/intro.dbase.php

Install dbase extension on php7, Ubuntu 16.04

I followed the instruction mostly based on mote0230 github.

Please be noticed that updating (and probably inserting) with arrays that contain named indexes, is not working. For my project, it is OK. I just need to read the data from dbf files.

dbase-pecl-php7

# PHP 7
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0-fpm php7.0-curl php7.0-mysql php7.0-dev 

Compile

# dbase for PHP 7
git clone git://github.com/mote0230/dbase-pecl-php7.git ~/php7-dbase
cd php7-dbase/
phpize
./configure
make
sudo make install
cd ~
rm -rf ~/php7-dbase

Continue reading “Install dbase extension on php7, Ubuntu 16.04”

Let Dreamhost PHP support Zip extension

The default PHP of DreamHost is not support Zip extension.
To let it support Zip. You need following steps.
1) Have your own customized PHP compile, which I posted before.
2) Then need to installing PECL Zip
Followed the guide on wiki.
The only difference I did, is to move zip.so file from
/home/username/php5/lib/php/extensions
to
/home/username/Domainname/cgi-bin/
Because I use cgi-bin as the extension folder.
Installation Difficult Rank: Easy
Time spend: 15 mins.
After install PECL zip extension, I can use PHP to create, modify, and read zip-format files.

  • Archives