Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Monday, March 6, 2017

downgrade php 7.1 to php 5.6

แก้ไขการอัพเกรดอูบันตูจาก 15.10 - 16.04 แล้วใช้ php v.7.0 ไม่สามารถ connect data base แบบนี้ mysql_connect ได้ เพราะใน php v.7.0 up เรียกแบบ mysqli_connect()

จะต้อง Downgrade php กลับมาใช้ php5.6 โดยยังคง php7 ไว้แต่ต้องปิดการทำงานไป ดังนี้

1.Install php5.6
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-mbstring php7.0-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0

2. disable php7 and enable php5.6
sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart

3. update service php5.6
sudo update-alternatives --set php /usr/bin/php5.6

Ref: how-can-i-downgrade-from-php-7-to-php-5-6-on-ubuntu-16-04


Wednesday, September 7, 2016

how to monitor linux server

Install package following page: quick-install-linux-dash-linux

Installation and Prerequisites

A CentOS 7 and Ubuntu 15.10 machine, git, Apache web server, PHP package.

Let us install the package with  CentOS 7 first

update system
#yum update

Install Apache, php and git packages
#yum -y install httpd git php php-json  php-xml php-common

Start httpd service
# systemctl start httpd
# systemctl enable httpd

Change working directory to /var/www/html
# cd /var/www/html

Download linux-dash usiing git
# git clone https://github.com/afaqurk/linux-dash.git

Restart  apache service
# systemctl restart httpd

To use:
/linux-dash


Install linux-dash with Ubuntu 15.10

Update system
# apt-get update
Install required packages
# apt-get install apache2 curl php5 php5-curl php5-json git
Change working directory to /var/www/html or your web directory Download package
git clone https://github.com/afaqurk/linux-dash.git
Start apache service
# /etc/init.d/apache2 start
Open Browser and start linux-dash monitoring system
/linux-dash