• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Jaranguda

Belajar Mengajar

  • Home
  • Sponsor/Jasa
  • Tentang

php

NGINX PHP-FPM No input file specified

Last Updated on 25 July 2018 By tommy Leave a Comment

file konfigurasi nginx dev.jaranguda.conf

server {
    listen       80;
    server_name  localhost;
    location / {
        root   /var/www/;
        index  index.html index.php;
    }
    location ~ \.php(?:$|/) {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        fastcgi_param modHeadersAvailable true;
        fastcgi_pass unix:/run/php/php7.1-fpm.sock;
        fastcgi_intercept_errors on;
    }
}

dengan konfigurasi diatas php masih menampilkan error “No input file specified.”

Error diatas muncul, karena location / tidak masuk dalam konfigurasi PHP-FPM dibagian location ~, solusinya sangat sederhana, pindahkan root lokasi folder anda ke atas atau dalam server {}, lengkapnya bisa dilihat dibawah

server {
    listen       80;
    server_name  localhost;
    root   /var/www/;
    location / {
        index  index.html index.php;
    }
    location ~ \.php(?:$|/) {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        fastcgi_param modHeadersAvailable true;
        fastcgi_pass unix:/run/php/php7.1-fpm.sock;
        fastcgi_intercept_errors on;
    }
}

setelah melakukan perubahan diatas, restart nginx

systemctl restart nginx

Filed Under: Linux Tagged With: nginx, php

Laravel Menambah Limit Memory PHP

Last Updated on 9 October 2017 By tommy Leave a Comment

Bila anda mendapati error seperti dibawah ini

FatalErrorException
Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes)

berarti aplikasi anda butuh memory lebih, konfigurasinya bisa ubah di php.ini
laravel out of memory

Edit file php.ini

Cari file php.ini, untuk mempermudah menemukan file tersebut jalankan perintah berikut ini di terminal

php -i | grep 'php.ini'

contoh output

# CentOS 7
$ php -i | grep 'php.ini'
Configuration File (php.ini) Path => /etc/opt/remi/php71
Loaded Configuration File => /etc/opt/remi/php71/php.ini
# Fedora 27
$ php -i | grep 'php.ini'
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
</div>
 
<pre lang="perl">
# bagian yang perlu diubah
memory_limit = 256M
# bagian ini untuk memperbesar file upload yang diijinkan
post_max_size = 20M
upload_max_filesize = 20M

setelah selesai restart PHP FPM

systemctl restart php-fpm.service
# atau
systemctl restart php71-php-fpm.service

Filed Under: Linux Tagged With: memory limit, php

Install PHP 7.1 Nginx MariaDB WordPress di CentOS 7

Last Updated on 15 March 2017 By tommy Leave a Comment

Sekarang ini WordPress merupakan pilihan utama untuk blog, situs perusahaan, situs belanja, dan banyak lainnya. Kemudahan pengoperasian dan maintenance WordPress menjadikannya sangat mudah digunakan untuk pemula sekalipun. Mmenginstall server untuk WordPress pun cukup mudah, bisa dilihat langkah demi langkahnya dibawah ini.

Pada tutorial ini saya akan menggunakan VPS Linode, tetapi cara yang sama bisa digunakan dimana saja selama masih sama-sama menggunakan CentOS 7.

Update CentOS 7

yum clean all
yum update -y

Install aplikasi yang dibutuhkan

yum install wget curl nano -y
yum install epel-release -y
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Install PHP 7.1

yum install php71-php php71-php-cli php71-php-common php71-php-json php71-php-intl php71-php-mbstring php71-php-mcrypt php71-php-mysqlnd php71-php-pdo php71-php-tidy php71-php-xml php71-php-fpm -y

PHP pathinfo

Setting cgi.fix_pathinfo dan zona waktu php

sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/opt/remi/php71/php.ini
sed -i 's/;date.timezone =/date.timezone = Asia\/Jakarta/g' /etc/opt/remi/php71/php.ini

Install MySQL / MariaDB

yum install mariadb-server mariadb -y

Buat database untuk WordPress

Login ke mariadb

mysql -u root -p

Buat database dengan nama wp dan user wp

create database wp;
GRANT ALL PRIVILEGES ON wp.* TO "wp"@"localhost" IDENTIFIED BY "YLxeJVNCzL3gMAJaMu4v";

Install Nginx

yum install nginx -y

Edit file konfiguras nginx /etc/nginx/nginx.conf, yang perlu ditambahkan

        include /etc/nginx/default.d/*.conf;
        location / {
		try_files $uri $uri/ /index.html;
        }
 
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

Setting agar php71-php-fpm berjalan sebagai nginx

sed -i 's/user = apache/user = nginx/g' /etc/opt/remi/php71/php-fpm.d/www.conf
sed -i 's/group = apache/user = nginx/g' /etc/opt/remi/php71/php-fpm.d/www.conf

Restart php71-php-fpm

systemctl restart php71-php-fpm

Install WordPress

wget wordpress.org/latest.tar.gz 
tar zxvf latest.tar.gz

Buka di browser http://IP.SERVER/wordpress
halaman install wordpress

Masukkan username, database dan password MariaDB yang tadi dibuat
WordPress masukkan credential
klik Submit

Pilih Bahasa
WordPress pilih Bahasa
klik Continue

Input informasi situs dan user admin
WordPress informasi situs
klik Install WordPress

Terakhir aktifkan mysql php71-php-fpm nginx agar otomatis jalan setelah restart/booting

systemctl enable nginx 
systemctl enable mariadb
systemctl enable php71-php-fpm

Filed Under: Linux, PHP Tagged With: CentOS 7, nginx, php, WordPress

Upgrade PHP5 Debian 8 Error

Last Updated on 25 January 2016 By tommy Leave a Comment

Log errornya sewaktu upgrade PHP5 menggunakan apt-get

Setting up php5-fpm (5.6.17+dfsg-0+deb8u1) ...
Job for php5-fpm.service failed. See 'systemctl status php5-fpm.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript php5-fpm, action "start" failed.
dpkg: error processing package php5-fpm (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php5:
 php5 depends on libapache2-mod-php5 (>= 5.6.17+dfsg-0+deb8u1~) | libapache2-mod-php5filter (>= 5.6.17+dfsg-0+deb8u1~) | php5-cgi (>= 5.6.17+dfsg-0+deb8u1~) | php5-fpm$
  Package libapache2-mod-php5 is not installed.
  Package libapache2-mod-php5filter is not installed.
  Package php5-cgi is not installed.
  Package php5-fpm is not configured yet.
 
dpkg: error processing package php5 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 php5-fpm
 php5

Solusi masalah diatas, pertama hapus php5-fpm, lalu install ulang

apt-get remove php5-fpm
apt-get install php5-fpm php5

Filed Under: Linux Tagged With: debian, php

Mengatasi Error Call to undefined function imageCreate()

Last Updated on 16 December 2015 By tommy 1 Comment

Error yang muncul sewaktu menggunakan thema Schema dari MyThemeShop

2015/12/15 14:33:41 [error] 30393#30393: *2392183 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to undefined function imageCreate() in /var/www/DOMAIN.com/wp-content/themes/Schema/options/google-typography/google-typography.php on line 723" while reading upstream, client: 125.xx.xx.240, server: DOMAIN.com, request: "GET /wp-admin/themes.php?page=theme_options HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "DOMAIN.com", referrer: "http://DOMAIN.com/wp-admin/"

error tersebut muncul karena di server anda belum ada library php-gd. Install dengan cara

# Debian/Ubuntu
apt-get install php5-gd
# Centos
yum install php-gd

Filed Under: Linux Tagged With: php

Upgrade PHP 5.4 ke PHP 5.6 Debian 7 Wheezy

Last Updated on 30 September 2015 By tommy Leave a Comment

Di repository Debian 7 (Wheezy), versi paling baru PHP adalah 5.4, sementara kebanyakan aplikasi sekarang membutuhkan PHP diatas versi 5.4, contoh ownCloud, Laravel, dll. Untuk mengupgradenya, ikuti langkah-langkah dibawah ini

1. tambah repository php56 dari dotdeb

echo "deb http://packages.dotdeb.org wheezy-php56 all" >> /etc/apt/sources.list

2. tambah key dotdeb

wget https://www.dotdeb.org/dotdeb.gpg
apt-key add dotdeb.gpg

3. Upgrade PHP
Bila anda menjalankan perintah

apt-get upgrade php5

maka PHP anda tidak akan terupdate/terupgrade, yang muncul

The following packages have been kept back:
  libapache2-mod-php5 owncloud owncloud-config-apache owncloud-server php-pear php5 php5-cli php5-common php5-curl php5-gd php5-intl php5-mcrypt php5-mysqlnd php5-pgsql php5-sqlite
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.

perintah yang benar adalah

apt-get install php5

sebelum upgrade PHP

$ php -v
PHP 5.4.45-0+deb7u1 (cli) (built: Sep 10 2015 08:34:47)

setelah upgrade PHP

$ php -v
PHP 5.6.13-1~dotdeb+7.1 (cli) (built: Sep  4 2015 17:30:11)

Filed Under: Linux Tagged With: debian, php

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to Next Page »

Primary Sidebar

Pencarian

Tanya Jawab tentang DevOps SRE CPE, gabung di https://t.me/devopsindonesia

Terbaru

  • Cara Mengganti Port Screen Sharing macOS
  • Cara Menonaktifkan Pager di macOS
  • Cara Mengupdate Nama Apple silicon-as-a-Service Scaleway
  • Cara Force Delete Namespace di Kubernetes
  • Install PHP MariaDB di Mac Monterey

Komentar

  • mazda on Tutorial Lengkap Install Mail Server Postfix Dovecot MariaDB di CentOS 7
  • adi on Menggunakan Mikrotik Sebagai SSH Client
  • aris u on Solusi Simple Queue Mikrotik Tidak Berjalan
  • Bowo on Cara Mematikan SSID Molecool Balifiber
  • aris on Solusi Simple Queue Mikrotik Tidak Berjalan

Tulisan Populer

  • Password Router Huawei HG8245H5 Indihome 1.2m views
  • Password Terbaru ZTE F609 Indihome 784.5k views
  • Password Superadmin Huawei HG8245A 318.7k views
  • Cara Setting Manual Modem GPON ZTE F609 Indihome 273.1k views
  • Cara Setting Wireless ZTE F609 Indihome 257.2k views
  • Mengaktifkan Port LAN di Huawei HG8245 Indihome 169.9k views
  • Akses UseeTV Indihome via Wireless ZTE F609 156.8k views
  • Kemana Menghilangnya Saldo BCA 50 ribu 153.4k views
  • Cara Reset Password ZTE F609 Indihome 147.6k views
  • Cara Setting DHCP Server Modem/Router ZTE F609 113.6k views

Kategori

  • Delphi
  • dll
  • Gambas
  • Internet
  • Java
  • Lazarus
  • Linux
  • PHP
  • Review
  • Teknologi

Sponsor

kadal.id
carakami.com
kuotabisa.com
Untuk jadi sponsor, hubungi kita lewat halaman sponsor
© 2021. Jaranguda
  • Linux
  • PHP
  • Internet
  • Teknologi
  • Delphi
  • Gambas
  • Java