Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

safiullah's avatar

Cant find Laravel valet nginx and php configration file directory

I am using Laravel valet and working on getting data from API which takes more than 3 minutes to return result. Now the problem is when I use curl or get_file_contents, I get timeout in 60 seconds and no matter which ini settings I add with code it doesn't change. So I searched how I can change nginx and PHP config settings in Laravel valet and the solution was to find the files in following directory:usr/local/etc/nginx/nginx.conf

The problem is that in my latest mac OS there is no folder called etc in usr/local diretory. Can anyone please help me. I really want to bypass this and make it work but I cant find any solution.

I tried adding following code in PHP script to avoid changing configuration files but it didn't work and I still get timeout at 60 seconds.

ini_set('max_execution_time', 2400); set_time_limit(900);

Also I tried using curl request with following settings: $ch=curl_init(); $timeout=2400; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $result=curl_exec($ch); curl_close($ch);

I just checked my valet logs and it shows following

2022/12/22 23:52:12 [error] 876#0: *2343 upstream timed out (60: Operation timed out) while reading response header from upstream, client: 127.0.0.1, server: , request: "POST /admin/ajax HTTP/1.1", upstream: "fastcgi://unix:/Users/username/.config/valet/valet.sock", host: "localsite.test", referrer: "http://localsite.test/admin/add-user"

0 likes
2 replies
gmgarrison's avatar

As far as I understand it, /usr/local would be a likely location for a Homebrew installation. I use Valet for my local dev and it keeps all of its config in ~/.config/valet.

If you're on a Mac, I also recommend PHP Monitor (https://phpmon.app) to help manage Valet. Good luck!

1 like
boboy's avatar

TLDR: if on Mac OS and Valet installed with Homebrew: /opt/homebrew/etc/nginx/valet/valet.conf

A bit late answer but I had a similar need, editing the valet.conf file (for opening to local network). The documentation states it's located in /usr/local/etc/nginx/valet/valet.conf but /usr/local/ect doesn't seem to exist on Mac OS. If you installed Valet using homebrew, the applications installed by it are in /opt/homebrew, so in my case the Valet configuration file can be found at /opt/homebrew/etc/nginx/valet/valet.conf

Hope it helps!

2 likes

Please or to participate in this conversation.