cwsoft Posted November 17, 2024 Posted November 17, 2024 (edited) @kongondoCool to know. So far used ddev exclusively from the bash shell, as I worked several years on Unix systems. However, I may check out this VS code Add-in with one of the next projects. Edited November 17, 2024 by cwsoft
dotnetic Posted November 17, 2024 Posted November 17, 2024 10 hours ago, nurkka said: does anybody use PHPStorm within WSL2 and could share some insights I use it with great speed (not using Mutagen, as it is not needed in WSL2). I also work with VScode (with WSL plugin from Microsoft) and it also works great. 1
cst989 Posted November 22, 2024 Posted November 22, 2024 One thing I've found is that most environments will show php warnings when using $config->debug = true but ddev will not. Does anyone worry/do anything about this?
zoeck Posted November 22, 2024 Posted November 22, 2024 You can create a custom PHP Configuration: https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#custom-php-configuration-phpini You can test something like this: File - .ddev/php/my-php.ini [PHP] display_errors = On; error_reporting = E_ALL; 4
kongondo Posted November 22, 2024 Posted November 22, 2024 7 hours ago, cst989 said: One thing I've found is that most environments will show php warnings when using $config->debug = true but ddev will not. Does anyone worry/do anything about this? This hasn't been my experience. DDEV shows both warnings and fatal errors. I haven't had to do anything special. What's your environment? 1
Ivan Gretsky Posted December 19, 2024 Posted December 19, 2024 On 11/6/2024 at 9:41 PM, kongondo said: Anyone got xdebug + WSL2 + DDEV + VScode working please? I have read the tut in the DDEV docs but it is not working for me. In VSCode the Xdebug session starts. On the website Xdebug doesn't kick in. After a while, VSCode breakpoints turn transparent and hovering over them says 'invalid breakpoint' or something like that. I did attempt all the WSL-related troubleshooting in the DDEV docs, e.g. the telnet connection. Was hoping for a question here. After a while VSCode says port 9003 closed. Sometimes I see notifications from ProcessWire (e.g. headers already sent) in the debug output. I am not sure whether and how to append the port number 9003 to the ddev url. E.g. mysite.ddev.site:9003. If I do this, the website hangs (chrome website cannot be reached). Any ideas? Thanks! Good day, @kongondo! Have you managed to get it to work? P.S. I have managed to make it work both for web and cli. The only thing that I still cannot figure out is how to launch a specific php file (see an example without ddev below). Still can't find out how to start it not with php but with ddev exec php. { "name": "Launch test.php", "type": "php", "request": "launch", "program": "${workspaceFolder}/test.php", "cwd": "${workspaceFolder}", "port": 0, "runtimeArgs": [ "-dxdebug.start_with_request=yes" ], "env": { "XDEBUG_MODE": "debug,develop", "XDEBUG_CONFIG": "client_port=${port}" } } I have tries adding "runtimeExecutable": "ddev exec php", but it didn't work for some reason: Error: spawn ddev exec php ENOENT at ChildProcess._handle.onexit (node:internal/child_process:285:19) at onErrorNT (node:internal/child_process:483:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -2, code: 'ENOENT', syscall: 'spawn ddev exec php', path: 'ddev exec php', spawnargs: [ '-dxdebug.start_with_request=yes', '...', '...' ] }
bernhard Posted December 21, 2024 Author Posted December 21, 2024 Have you ever realised that DDEV only works when you are connected to the internet? No? Then all fine 😉 If you did, I have good news for you! DDEV does NOT require a working internet connection! You can, of course, use it for local development without being online - for example on a plane. The only thing you need to know is that if you started the project via "ddev start" while being connected to the internet and then you go offline, then your browser will not find your project any more. All you have to do to solve that is to run a "ddev restart" 🙂 The reason for this is explained here: https://ddev.com/blog/ddev-name-resolution-wildcards/ @gebeer 2
gmclelland Posted April 18 Posted April 18 Great video by the DDEV creator that shows how to troubleshoot problems in your codebase by using DDEV with xdebug and breakpoints in his PHP editor. Then he shows how to go deeper by using DDEV and git bisect with a known good git point in the past when everything was working correctly and the current git commit where everything is broken. Then he shows how to take it further and automate all the manual steps he took and instead use a bash script that does the same thing but much faster. 4
cwsoft Posted August 2 Posted August 2 (edited) I want to share another function-alias (.bash_aliases) I use quite often when dealing with DDEV and composer on my Windows WSL2 setup. I usually install PW via GIT and add 3rd party composer packages into site/vendor instead of PW root. function ddcomp() { if [ -e "$PWD/composer.json" ]; then WORKDIR=$(basename $PWD) ddev composer --working-dir="$WORKDIR" "$@" else ddev composer --working-dir="." "$@" fi } The alias-function ddcomp checks if the actual directory you enter the command contains a composer.json file. If it does, it assumes the base folder (e.g. site) as --working-dir for composer. If there is no composer.json file, the actual dir is used instead. This way you can type e.g. ddcomp config --list inside the PW site folder containing the composer.json file instead of using ddev composer --working-dir=site config --list. For setting up PW from scratch you can use ddcomp create-project processwire/processwire. Edited August 3 by cwsoft 1
Jonathan Lahijani Posted Thursday at 09:20 PM Posted Thursday at 09:20 PM I'm planning on using DDEV sometime in the next few months when I buy a new computer (most likely Framework Desktop) and hopefully switch to Linux (looking to use Omarchy). It's going to be painful in the beginning (I really REALLY don't want to give up XYplorer and I hope I can adjust to a tiling window manager way of doing things), but Omarchy is where it's at for web developers. Right now, my dev setup is pretty simple: I have a separate bare-metal server (an old Dell Xeon workstation) running Ubuntu 24.04 and a LAMP stack (mostly everything installed with apt). I have Samba setup so I can access files from my Windows desktop machine for convenience. I use VSCode Remote SSH extension to edit files directly on the server. This has served me well and is not complicated at all. All of my ProcessWire projects exist there. One thing I do to keep things as efficient as possible is symlink the 'wire' directory of all my projects to a single folder that contains the latest version of ProcessWire (I'm not using Composer to manage ProcessWire itself). Therefore, if I want to update all my sites to the latest version of ProcessWire, I just symlink that folder and all the other sites are automatically updated. Sure, that kind of goes against proper source code control practices and such, but I'm always a solo developer and the strict level of isolation of environments between sites is typically not needed for 99% of the sites I work on, which is kind of the point of Docker/DDEV, but I still want to use it. Updating ProcessWire in this way is very efficienct (at the 'expense' of a potential site breaking which is very very rare). So my question is, if I have 50 ProcessWire sites created with DDEV, can I still symlink the 'wire' folder of all of them the same way I described above without any issues? I'm very rusty with Docker but looking to embrace it heavily. Also, is it "crazy" to have 50 ProcessWire projects started all at once (will that take up a lot of resources)? With my current setup, I don't have to launch anything because it's all served by a single Apache, MariaDB and PHP which is very convenient. With DDEV, I have to launch each one individually.
gebeer Posted yesterday at 12:58 AM Posted yesterday at 12:58 AM 3 hours ago, Jonathan Lahijani said: So my question is, if I have 50 ProcessWire sites created with DDEV, can I still symlink the 'wire' folder of all of them the same way I described above without any issues? I'm very rusty with Docker but looking to embrace it heavily. Yes, you can. The project files live on the Linux host machine (your Omarchy setup). They are being mounted to the ddev containers as docker volumes. The Docker daemon follows all symlinks to their real locations. So you can have a similar setup as on your current Ubuntu server. 3 hours ago, Jonathan Lahijani said: Also, is it "crazy" to have 50 ProcessWire projects started all at once (will that take up a lot of resources)? Kind of, yes :-) Depends on how juicy your new machine is. ddev spins up a few docker containers for each project. The more projects you have running the more containers need to be started. I have never started more than 3 projects at the same time. So can't really tell what happens if you spin up 10 or more. Are you working on multiple projects at the same time daily, do you really need them to be available at the same time? project startup is quite fast. So there's no need to have them all running all the time. You can manage them through docker desktop or Vscode extension or CLI, of course. All ddev projects are managed through one ddev-router container (Traefik) which acts as reverse proxy for http/s calls. So if you have multiple projects running, they can access each other through http. 3 hours ago, Jonathan Lahijani said: and hopefully switch to Linux (looking to use Omarchy). Just do it man. You won't regret. Linux has plenty of file explorers to choose from, you can find a decent replacement for XYplorer for sure. I live in Thunar. It has a plethora of plugins (batch rename etc) and is very customizable. As for Omarchy, it is a very opinionated setup but should give you a great starting point. I moved to tiling WMs some years ago and now wouldn't want to miss them. It's just so much more organized. I know exactly which application lives on what workspace and can switch in a blink of a keystroke. Who the heck needs frickin floating windows, why were they even invented? 1
Jonathan Lahijani Posted yesterday at 02:53 AM Posted yesterday at 02:53 AM 1 hour ago, gebeer said: Are you working on multiple projects at the same time daily, do you really need them to be available at the same time? project startup is quite fast. Oftentimes it's 3-5 projects at a time, with other projects being dormant or semi-dormant for a while. However there are times when I want to apply some setting across all of my sites, even the dormant ones. For example, a few years ago I decided to use SessionHandlerDB instead of the default, file-based session approach. I did this manually across all 50 sites (I suppose I could have scripted this). No need to boot up each development site with my current approach since it's all on a single LAMP server. But with Docker/DDEV, I'll have to spin up DDEV for each project then make the change, then shut it down. A little extra friction, but thinking about it as I write this, I don't think it's as bad as it sounds and I can probably automate it to some extent. How do you personally handle situations like that? If I get a Framework Desktop, I would get it with 128GB memory. It's very powerful.
gebeer Posted yesterday at 03:40 AM Posted yesterday at 03:40 AM 48 minutes ago, Jonathan Lahijani said: I did this manually across all 50 sites (I suppose I could have scripted this). You could do that with RockMigrations $rm->installModule('SessionHandlerDB'). Add it to the migration file on every site. Don't even need to spin up. Will be applied next time you login as superuser. 48 minutes ago, Jonathan Lahijani said: If I get a Framework Desktop, I would get it with 128GB memory. It's very powerful. That should suffice :-) 1
Ivan Gretsky Posted yesterday at 12:23 PM Posted yesterday at 12:23 PM Hi, @Jonathan Lahijani! I am pretty sure that your existing setup is superior for the multiproject needs of yours comparing to ddev. You try to standardize while ddev is all for making something custom. I would play with some new php stuff on ddev to keep up with the hype. But would stay with you current setup for the paid work. 2
elabx Posted yesterday at 02:11 PM Posted yesterday at 02:11 PM 16 hours ago, Jonathan Lahijani said: Also, is it "crazy" to have 50 ProcessWire projects started all at once (will that take up a lot of resources)? Snapshot of the moment, got a Mac Studio with 64GB of ram and running around 8-10 projects everything goes smooth. Got the docker provider using around 16GB of memory. 10 hours ago, gebeer said: You could do that with RockMigrations $rm->installModule('SessionHandlerDB'). Add it to the migration file on every site. Don't even need to spin up. Will be applied next time you login as superuser. I do this too, but I don't auto run it on login. 16 hours ago, Jonathan Lahijani said: With DDEV, I have to launch each one individually. I can see how this could be a bottleneck, I don't think it's unbearable to start every project when needed since like you mention, you actively work in a few of them. With your 128GB of ram I'd definitely give it a shot because yolo haha. "ddev start --all" let's go! 1 1
Jonathan Lahijani Posted yesterday at 03:19 PM Posted yesterday at 03:19 PM Thinking about it further, I could probably go with a hybrid approach too. On my new Linux machine, I could set up a LAMP stack directly and run the projects that don't need the level of isolation DDEV provides (which is mostly all my projects) and only use DDEV for projects that would benefit from it (mainly this webapp I've been working on for the last couple years). The main point is that I want everything on one powerful development machine. My old Dell workstation is showing its age when running that webapp, although in production is pretty fast. Thanks for the insights and suggestions!
FireWire Posted 22 hours ago Posted 22 hours ago 22 hours ago, Jonathan Lahijani said: most likely Framework Desktop) and hopefully switch to Linux Framework 16 daily driver here, excellent choice. Linux? Do it! Outstanding support on the hardware and once you settle in you'll wonder how you ever had to endure Windows. 1
Recommended Posts