Skip to content

Instantly share code, notes, and snippets.

View marlonpd's full-sized avatar

Marlon Dizon marlonpd

View GitHub Profile
First you need to do two things:
You need to check if php rewrite module is enabled. you can do it with phpinfo(). Write this in a file info.php and open in browser: http://localhost/info.php
Now search for mod_rewrite. If you see mod_rewrite in this page that means, mod_rewrite is enabled.
If mod_rewrite is not enabled, enable it. I enabled in in ubuntu 18.04 for apache with this command: $ sudo a2enmod rewrite. Then restart apache2 $ systemctl restart apache2
if mod_rewrite is enabled, then other configuration will work.
Then add AllowOverride All in .conf file:
cd /etc/apache2/sites-available
@marlonpd
marlonpd / con
Created January 17, 2019 04:07
We want to auto login users in phpMyAdmin
Edit config.inc.php
Location : /usr/share/phpmyadmin/config.inc.php
Find for the blow code
$cfg['Servers'][$i]['auth_type'] = 'cookie';
And replace the line of code by blow code
<?php
namespace App\Http\Controllers\admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\ProductCategory;
use App\Product;
use Auth;
use Image;
<?php // add this file in app/config/ folder
return ['userRole' =>
['admin' => 1,
'client' => 2,
],
'userStatus' =>
['pending' => 0,
'active' => 1,
'banned' => 9,
@marlonpd
marlonpd / resolvemysql server start failed
Last active January 14, 2019 06:55
in the log [Tue Oct 16 15:10:56.083647 2018] [log_config:warn] [pid 1873] (28)No space left on device: [client 192.168.33.1:64563] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
sudo apt-get clean
sudo apt-get -f autoremove
sudo service mysql start
delete log files
sudo find /var/log -type f -regex ".*
\.gz$" -delete
@marlonpd
marlonpd / tinycme modal issue
Created February 24, 2018 18:12
fixes for tinymce upload in modal issue
$(document).on('focusin', function(e) {
if ($(event.target).closest(".mce-window").length) {
e.stopImmediatePropagation();
}
});
@marlonpd
marlonpd / git erro
Created February 17, 2018 02:35
git error - master branch and 'origin/master' have diverged
master branch and 'origin/master' have diverged
Solution
git reset --hard origin/master
@marlonpd
marlonpd / laravel-vue X-CSRF-TOKEN issue
Last active January 23, 2018 17:36
//place in main js file containing vue
Vue.http.interceptors.push(function (request, next) {
request.headers['X-CSRF-TOKEN'] = Laravel.csrfToken;
next();
});
@marlonpd
marlonpd / Vagrant Error and fix
Created January 13, 2018 06:42
Vagrant Error: There are errors in the configuration of this machine. Please fix the following errors and try again: vm: * A shared folder guest path is used multiple times. Shared folders must all map to a unique guest path: /vagrant
Fix : need to add id: "vagrant-root", disabled: true
config.vm.synced_folder "D:/Projects/www/server", "/vagrant/", id: "vagrant-root", disabled: true