View cakephp3_debugKit_sqlite.txt
sudo apt-get install php5.6-sqlite3
sudo service apache2 restart
View create_swap_for_low_memory.txt
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
sudo rm -rf vendor
sudo php -dmemory_limit=750M composer.phar update --no-scripts --prefer-dist
sudo php artisan --dump-autoload
View to_allow_cake_root_directory.txt
In the main htaccess:
RewriteRule ^node_modules/(.*) node_modules/$1 [L]
RewriteRule ^vendor/(.*) vendor/$1 [L]
Put a htaccess in the target directory with the following:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
View https_forwarded_proto.php
//for elasticbeanstalk in .ebextensions/.config
- option_name: HTTPS
value: 1
//or in .htaccess
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
View Sentora vhost + Laravel
1. Go to Module Admin.
2. Click Apache Config.
3. Scroll to bottom, look at "Override a Virtual Host Setting" section, select your vhost from dropdowns.
4. In "Custom Entry" field, paste the following code:
`DocumentRoot "/var/sentora/hostdata/[username]/public_html/[domain-alias]/public"`
Replace [username] with your login username, and [domain-alias] with your domain directory friendly name ( => domain_com).
5. "Save Host" and waiting for Sentora Daemon, or from terminal, reload httpd service:
View CC_CakePHP_Validation.php
->add("card_number", [
"custom" => [
"rule" => [$this, "cardCheckFunction"],
"message" => "Please enter a valid card number."
View Install SSL Sentora
# Install OpenSSL
apt-get install openssl
# Create a directory for your certificates
mkdir /etc/apache2/ssl/
# Create the certificates
View wordpress_sitemap.php
function sitemap_func($atts)
$type = 'post';
if (isset($atts['type']) && $atts['type']) {
$type = $atts['type'];
query_posts('posts_per_page=-1&post_type=' . $type);
if (have_posts()) :
View mac_windows_10_wifi_fix.txt
Device Manager -> Network Adaptars -> Properties -> Advance -> Power Output -> 25%.
View vendor_clean_cache.txt
bower cache clean
composer clearcache
npm cache clean .