Setting up Laravel on a Mac php artisan migrate error: No such file or directory [duplicate]

If you are using MAMP be sure to add the unix_socket key with a value of the path that the mysql.sock resides in MAMP. ‘mysql’ => array( ‘driver’ => ‘mysql’, ‘host’ => ‘localhost’, ‘unix_socket’ => ‘/Applications/MAMP/tmp/mysql/mysql.sock’, ‘database’ => ‘database’, ‘username’ => ‘root’, ‘password’ => ‘root’, ‘charset’ => ‘utf8’, ‘collation’ => ‘utf8_unicode_ci’, ‘prefix’ => ”, ),

malloc vs mmap in C

Look folks, contrary to common believe, mmap is indeed a memory allocation function similar to malloc.. the mmaped file is one use of it.. you can use it as memory allocation function passing -1 as file descriptor.. so.. the common use is to use malloc for tiny objects and mmap for large ones.. this is … Read more

Will malloc implementations return free-ed memory back to the system?

The following analysis applies only to glibc (based on the ptmalloc2 algorithm). There are certain options that seem helpful to return the freed memory back to the system: mallopt() (defined in malloc.h) does provide an option to set the trim threshold value using one of the parameter option M_TRIM_THRESHOLD, this indicates the minimum amount of … Read more

Mmap() an entire large file

MAP_PRIVATE mappings require a memory reservation, as writing to these pages may result in copy-on-write allocations. This means that you can’t map something too much larger than your physical ram + swap. Try using a MAP_SHARED mapping instead. This means that writes to the mapping will be reflected on disk – as such, the kernel … Read more

Unexpected exec permission from mmap when assembly files included in the project

Linux has an execution domain called READ_IMPLIES_EXEC, which causes all pages allocated with PROT_READ to also be given PROT_EXEC. Older Linux kernels used to use this for executables that used the equivalent of gcc -z execstack. This program will show you whether that’s enabled for itself: #include <stdio.h> #include <sys/personality.h> int main(void) { printf(“Read-implies-exec is … Read more

mmap() vs. reading blocks

I was trying to find the final word on mmap / read performance on Linux and I came across a nice post (link) on the Linux kernel mailing list. It’s from 2000, so there have been many improvements to IO and virtual memory in the kernel since then, but it nicely explains the reason why … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)