Langsung ke konten utama

Postingan

Menampilkan postingan dari Februari, 2020

how to install postgresql and use it with php on termux

first of all you need to install it: apt install postgresql then specify data dir for it by typing: initd -D YOUR_DATA_DIR example YOUR_DATA_DIR is /data/data/com.termux/files/home/mydb note that you don't need to make the dir first, you just need the dir name then initdb will create it automatically :) in this example like this: initdb -D /data/data/com.termux/files/home/mydb The files belonging to this database system will be owned by user "u0_a171". This user must also own the server process. The database cluster will be initialized with locale "C.UTF-8". The default text search configuration will be set to "english". Data page checksums are disabled. creating directory test ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... sysv selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Asia/Jakarta creating configuration files

How to run PHP in nginx and fix the errors

first you gonna need to backup the conf file in order when you did something wrong, who knows tho? and then edit them; dunno wheres the config file located? just run nginx -t and it will show you wheres the conf file and its content. now just edit it with the following: put root YOUR_INDEX_ROOT;  at the top and inside of http { params the purpose is to set it as global root directory . and within location ~ \.php$ {  edit with the following params: try_files $uri =404; # try to find the file, if fail throw 404 error             #root           /data/data/com.termux/files/home/sdcard/www; # this is the root dir of php files             fastcgi_pass   unix:/data/data/com.termux/files/usr/var/run/php-fpm.sock; # pass every php file to this server             fastcgi_index  index.php; # the index file name             #fastcgi_split_path_info ^(.+\.php)(/.+)$; # ?             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; # param for fastcgi to find the