Rabu, 28 Agustus 2019

travis ci + Laravel

tambah env.travis yang isinya file env.example

buat travis.yml seperti ini :

language: php

php:
- 7.2

services:
- mysql

before_script:
- cp .env.travis .env
- mysql -e 'create database test;'
- composer self-update
- composer install --no-interaction
- php artisan key:generate
- php artisan migrate

script:
- vendor/bin/phpunit

Untuk Settingan lainya bisa di sesuaikan dengan env.

tengkyu

Senin, 26 Agustus 2019

Rabu, 13 Maret 2019

operasi git

git init

git remote add origin <git repo>

git pull -u origin master

git push -u origin master

Sabtu, 09 Maret 2019

Apache2 sudah di instal tapi status inactive dead / apache2 not work

Pengalaman saya.
saya pernah instal 2 php 1 php 5.4 untuk kerja satau lagi 7.2 untuk belajar
suatu ketika ketika saya sudah tidak pakai linux saya ingin full linux untuk belajar jadi saya mau php cuma ada 1 7.2

masalah muncul ketika saya otak atik apache2 , tidak tau kenapa saya maen purge atau remove aja file2 php 5.4 nya. dan masalah muncul apache 2 sudah di instal dan terbaru tapi localhost di browser tidak jalan,

untuk masalah ini solusi pertama karena makin pusing cari solusi saya instal aja yang gampang2 install xampp di linux berarti lampp

sekian lama pakai lampp enggak tau kenapa kepikiran mau pakai apache2 lagi , mungkin karena mau coba xdebug di vscode error (eror mungkin saya nya yang ga tau pake nya).

beberapa jam cari solusi biar fungsi kembali ini status terakhir apache2 saya


● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: inactive (dead) since Sat 2019-03-09 18:45:49 WIB; 14min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 9571 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 9564 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

Mar 09 18:45:49 ad systemd[1]: Starting LSB: Apache2 web server...
Mar 09 18:45:49 ad systemd[1]: Started LSB: Apache2 web server.


saya cek semua kemungkinan

pertama beberapa kali reinstal apache2 > tidak jalan
cek port 80  > tidak ada yang pakai

lalu setelah googling yang lumayan lama. katanya cek configurasi nya

sudo apachectl configtest

/usr/sbin/apachectl: 165: /usr/sbin/apachectl: /usr/sbin/apache2: not found
Action 'configtest' failed.
The Apache error log may have more information.

ternyata folder sbin hilang, kemungkinan saya hapus ketika saya hapus php 5.4 (maklum awam linux)

solusinya si simple reinstal sbin yaitu

sudo apt-get --reinstall install apache2-bin

di cek status masih belum jalan, kampret. cek lagi configtest ternyata masih error

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK

ok kalau error nya kaya di atas si saya tau ini harus di tambahin servername di apache2.conf

langsung aja deh buat 

sudo vim /etc/apache2/apache2.conf

berhasil nih kayanya, tapi ehh.. masih gagal cek lagi error nya sama teteapi di bawah status apache2 ada error baru

Mar 09 19:06:38 systemd[1]: Started LSB: Apache2 web server.

ahhh makin pusing , terakhir kalinya saya reinstal lagi apache 2 nya 

sudo apt-get --purge remove apache2
sudo apt-get autoremove
sudo apt install apache2 libapache2-mod-php7.2
sudo /etc/init.d/apache2 restart

wooow..active ternyata

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Sat 2019-03-09 19:09:37 WIB; 20min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 15446 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 15468 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/apache2.service
           ├─15485 /usr/sbin/apache2 -k start
           ├─15488 /usr/sbin/apache2 -k start
           └─15489 /usr/sbin/apache2 -k start


sebenarnya masih ada error si di apache tpi kayanya ga terlalu susah. segini aja deh catatan saya . tengkyu

Instal php debug

sebagai catatan buat saya si

pertama

php -i > php-info.txt


copy hasil dari php-info.txt ke https://xdebug.org/wizard.php

ikuti langkah dari analisa xdebug

jika belum ada phpize

instal dengan  cara sudo apt-get install php7.2-dev (versi sesuaikan)
https://xdebug.org/docs/faq#phpize

...