Categories
Fixing Stuff Laravel Samuel

laravel email error notes

troubleshooting a couple small laravel errors. First one = “belongs-to-many” database lookup error. It was from a view trying to show old data that was missing (IE we had a data set present, then half of it was deleted and the site did not gracefully degrade to still show the view). The fix for this was to just purge the rest of the data (it happened to be test data so that was fine). Now since a user can’t input incomplete data into the view the page should be good to go.

then we had a contact form timing out a “swiftmailer” error. We had the .env file on port 465 but needed 587, and then we noticed there were a couple things hard coded in config > mail.php that were from a previous project. We updated this mail file to the correct info, and also made the needed changes in the .env file so that in the future that file can quickly override the mail.php file for ease of updating.

BadMethodCallException] This cache store does not support tagging. Laravel file and database drivers doesn’t support tags.

to fix find the cache drive in .env file and update it to:
CACHE_DRIVER=array

Categories
Fixing Stuff Laravel Samuel

Fixing PHP Error: Maximum function nesting level of ‘100’ reached, aborting

when copying a Laravel project from production down to my local machine today I got the following error while trying to access a specific page:

PHP Error: Maximum function nesting level of '100' reached, aborting

This was a first for me to see this, also of note I was not running this locally on wamp, I was simply serving the file with php artisan serve on windows using git bash. To fix the issue we took the following steps:

-locate the controller that powers the page generating the error (if you don’t know this off the top of your head, start back at your routes.php file). Look through the routes file unitl you find the correct controller.

-open up the controller and locate the function that is controlling the front end view (the page where your error is occurring). Next test to make sure you have the right function by adding dump and die to the top of your function:

dd($value);
*note you can also just use something like: dd('test');

-if you have the correct spot then the page will display your DD (dump and die) message. Once you confirm this then add the code below to fix the maximum function nesting error:

ini_set('xdebug.max_nesting_level', 200); //put this in here to fix local ini_set limit

That’s all there is too it. Also a side note its not a great practice to do this as a long term fix, there are probably larger issues at play that need to be addressed. But in my current case this worked perfectly and if anyone out there is running into the same issue hopefully this helps you solve it.

Categories
Fixing Stuff Samuel

Cleaning A Few Things Round The House Without Chemicals

This is just a reminder post to myself about a few super useful cleaning techniques I have tried recently to clean stuff around the house.

1.) Cleaning microwave with lemon. Cut Lemon in half, squeeze into small bown then fill the bown with 2 cups of water. Place in microwave on high for 4-5 minutes. Once the timer finishes let the bowl site in the microwave for 1 minute (do not open the door). Last step is open the door and wipe everything down with a sponge (dip the sponge in the lemon water if anything is still stuck on the microwave surface).

2.) Repeat steps above but in the oven. Turn oven to 350 for 40 minutes when cooking the lemon water (make sure to place water in oven safe container, pyrex is best). Use same sponge to wipe off oven surface after lemon water has cooked for (make sure the water gets hot enough to boil).

3.) Clean cast iron skillet with potato. Cut potato in half, pour salt into the pan then rub potato over the cast iron (can use baking powder as well). If the potato gets too dirty, just cut the end off and repeat. Super effective for cleaning the cast iron and not scraping it.

Better explanation of the potato trick here: http://toriavey.com/how-to/2014/02/how-to-clean-and-season-a-cast-iron-pan/

Categories
Fixing Stuff Samuel

notes for troubleshooting wamp install

To see what else is running on port 80:
(in the command prompt run)
netstat -aon| findstr :80

To Fix error message:
vcruntime140.dll is missing from your computer

Fix by downloading Redistributable C++
or
If that one doesn’t work, fix by downloading the 2012 version

–note–
the 2012 version successfully installed for me on windows 7, 2015 version would not install

path to httpd.conf file:
C:\wamp\bin\apache\apache2.4.17\conf

**tip** open this in notepadd++ for improved formatting

Fix the broken links to folder on the default localhost page:
find the local host suppression code and set to false
$suppress_localhost = false;

That is all for now, I will continue to add tips onto this page as I find them…. the next thing I would really like to do is set a symlink from the wamp www folder to my local freenas machine, this would look something like:

/wamp/www/projectx /freenas/path-to-website-files/projectx

I’m pretty sure this can be done, it for sure can be done locally but adding in the complexitiy of doing of a cifs windows share is a little too much for today….. will save that for another time.

Categories
Fixing Stuff Samuel

SSH Commands to Search for Hacked Files

So if you have a WP site that gets “hacked” and you want to search for what files are effected there are a couple nice server commands you can run to make the process of finding the files much faster:

1.) Search your entire site for base64 code

grep -r base64_decode *

2.) Search for files recently changed

find ~/public_html -type f -ctime -7

*This example searches for any files changed in the last 7 days, you can update the -7 to any day amount

Categories
Fixing Stuff Freenas Samuel

fixing file permissions for windows on freenas cifs share

So I ran into an issue today where I could not copy a file from my freenas machine down to my local windows machine. The exact error message was:

you need permission to perform this action

you require permission from Unix User\”username” to make changes to this file.

The solution to this problem is to open up your freenas shell window (just navigate to your machine in the browser window, login and hit shell). Once you do that locate the file you want to move and type “chmod 777 filename” and hit enter. That will change the permissions on the file and you will be able to copy it over to your local windows machine.