PHP Reddit – Telegram
PHP Reddit
34 subscribers
289 photos
37 videos
24.8K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
Two weeks ago I opensourced my pure PHP static site generator

As the noscript says I released my static site generator phpssg opensource on github a few weeks ago in this post and I got a crazy amount of support and really helpful constructive feedback. Today I wanted to give you all an update on how it's going.

I published the latest stable version on packagist so now it's really simple to get started with just require taujor/phpssg, I rethought the entire build system because it was difficult to pull data in from remote API's etc. I refined the documentation and have kept everything super minimal. I'm going to add an example template next week as a way to quick start your project. Another big feature I have planned for the coming weeks are Hooks, so you can easily extend the internal builder class with your own custom functions that will be ran at specific points in the build process. The generator is already quite extendable through utilities and the fact that it is an extremely thin layer over vanilla php. You can even mimic server island functionality (like astro) by combining this with a typical php server.

I will be adding tutorials and exploring what we can really achieve in php with static site generation on the project website which is also being built in the coming weeks (phpssg.com)

I hope you enjoy using phpssg as much as I did building it. Let me know what you think, I'm always open to discussion/criticism.

https://redd.it/1o4qx1p
@r_php
Is my Deployer configuration correct for a small Laravel + Inertia project?

Hi everyone,

I'm working on deploying a small project for a rental company. The backend is **Laravel + Inertia**, and I'm using a low-cost VPS (€8/month). I wrote a Deployer noscript to handle:

* PostgreSQL installation and database setup
* Nginx + PHP-FPM configuration
* Node/npm install and build
* Laravel shared directories and writable permissions

My questions:

1. Does this look like a proper setup for a small Laravel + Inertia project?
2. Are there any obvious mistakes or security issues?
3. Anything I should improve for a VPS with limited resources?

Thanks in advance!

Here’s a simplified version of my noscript with sensitive info removed:

namespace Deployer;

require 'recipe/laravel.php';

// Config
set('application', 'Rentalia');
set('repository', 'git@github.com:***.git');
set('git_tty', true);

// Shared files/dirs
add('shared_files', ['.env']);
add('shared_dirs', ['storage']);
add('writable_dirs', [
'bootstrap/cache',
'storage',
'storage/app',
'storage/app/public',
'storage/framework',
'storage/framework/cache',
'storage/framework/sessions',
'storage/framework/views',
'storage/logs',
]);

// Hosts
host('production')
->setHostname('***.***.***.***')
->set('remote_user', 'root')
->set('deploy_path', '/var/www/rentalia')
->set('branch', 'main');

// Tasks
task('postgres:setup', function () {
writeln('Installing PostgreSQL...');
run('apt-get install -y postgresql postgresql-contrib');

writeln('Creating database and user...');
run('sudo -u postgres psql -c "CREATE DATABASE rentalia;"', ['timeout' => 300, 'tty' => false]);
run('sudo -u postgres psql -c "CREATE USER rentalia_user WITH PASSWORD \'***\';"', ['timeout' => 300, 'tty' => false]);
run('sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE rentalia TO rentalia_user;"', ['timeout' => 300, 'tty' => false]);
})->desc('Install and configure PostgreSQL');

task('webserver:setup', function () {
writeln('Installing Nginx and PHP-FPM...');
run('apt-get update');
run('apt-get install -y nginx php8.3-fpm');
// Nginx configuration omitted for brevity
})->desc('Install and configure Nginx');

task('npm:install', function () {
run('cd {{release_path}} && npm ci');
});

task('npm:build', function () {
run('cd {{release_path}} && npm run build');
});

// Hooks
after('deploy:vendors', 'npm:install');
after('npm:install', 'npm:build');
after('deploy:failed', 'deploy:unlock');




https://redd.it/1o4r1tf
@r_php
Weekly /r/Laravel Help Thread

Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:

What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.

For more immediate support, you can ask in the official Laravel Discord.

Thanks and welcome to the r/Laravel community!

https://redd.it/1o4uebv
@r_php
How to properly deploy using laravel?

I bought a domain on Hostinger with no vps server (Shared hosting) , i uploaded my *Laravel* files in domain's file manager and made sure that public files only in public_html , what is the next steps ?

https://redd.it/1o50rnv
@r_php
Weekly Ask Anything Thread

Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.

https://redd.it/1o58rlv
@r_php
Any Resources for Learning How to Create Miroservices in Core PHP or in any Framework?

I have experience with Core PHP, Laravel, and a bit of Symfony and WordPress. I’ve also completed several projects. Now, I want to learn how to build microservices using PHP. Could someone recommend tested and reliable resources for that?

https://redd.it/1o5aa4x
@r_php
Weekly help thread

Hey there!

This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!

https://redd.it/1o5bs2r
@r_php
is PHP dying?

Forgive me if this topic has been discussed to death, but I'd love to hear from other folks.

I learned PHP a long time ago, and for years I had no trouble finding work. There were plenty of sites that were LAMP based (or nginx, or maria, or postgres, but you get the idea -- PHP).

Now I cannot find any job postings that are looking for PHP. I'm surprised, though, as there must still be so many site and SAAS products that were written in PHP, and still need support and feature development.

Any opinions?



https://redd.it/1o5irx1
@r_php
phpMyAdmin - database column order

Hello

In my table "marrdata" I have 14 columns.

I understand that it's the column name rather than number that matters, but I wanted to check - if I add in another two columns, does it matter if they upset the current order?

Eg currently it is:

1 - IDNo

2 - Year

3 - Name

4 - Page

5 - Notes

I'd like to have

1 - AnsID

2 - IDNo

3 - Year

4 - Name

5 - Page

6 - AnsNotes

7 - Notes


thanks



https://redd.it/1o5lwvu
@r_php
CodeIgniter vs "the others"

I saw a similar post the other asking for recommendations between CodeIgniter, Laravel and Symfony. It got me to wondering about some of the comments in that thread.

It is mentioned several times in the comments "if you have large project, go with XYZ". I am curious what your definition of a large project is. I have used CodeIgniter over the years to develop what I consider to be small to medium sized projects (event registration systems mostly). About three years ago I stuck with CodeIgniter (4.x) when I started, what has become, a huge project (at least for me). The controller files, for instance, probably have 200,000+ lines of code in total. Obviously there are dozens and dozens of related files (views, helpers, shared functions, config, etc) as well. Does that fit the definition in your eyes of "large"?

Lately I have begun to wonder if I went down the wrong road and should have looked around a little harder at the alternatives. Are Laravel/Symfony so different that a rewrite would be a ridiculous undertaking? I realize these are pretty broad strokes, but the topic got me curious.

https://redd.it/1o5nqg9
@r_php
Looking for help with a project!

https://github.com/andrewthecodertx/6502-Emulator

This is becoming a really large project and has some complexity to it. Would love some contributers, or even just some more senior devs to offer some advice.

Thanks.

https://redd.it/1o5wdfx
@r_php
OpenCart is awful, what are some decent alternatives written in PHP?

Sorry if this is the wrong subreddit, I wasn't sure where else to post it. If this is the wrong place, please point me to the right sub.

I'm helping a friend convert their shop to an actual ecommerce solution - right now they're just using some fairly insecure, poorly written PHP they made themselves (They learned PHP making this). It has several issues that I'd like to fix by using a proper solution.

So after little research, I decided to go with OpenCart - it looked decent enough on the frontend, so why not? Well... Once I started trying to modify it to how he wanted it (Share the main site's theme, try to recreate the product listing he had for his shop, etc.) I ran into so many problems. I can fix them with enough time, but I'm not getting paid enough to spend 20 hours reworking this for what should be minor changes, or features already built-in.

So - what are some good alternatives written in PHP that are easy to work with, somewhat modern, and customizable?

https://redd.it/1o5wtun
@r_php
can not connect to Xdebug running into docker from phpstorm (waiting for incoming connection with ide key docker)

I have tried many things and searched too much about this but still have no idea why I can not connect, lemme break down all the problem,

this is how I setup docker using this image github.com/8ctopus/apache-php-fpm-alpine/
```>
> services:
> web:
> # php 8.4.8
> image: 8ct8pus/apache-php-fpm-alpine:2.3.4
> hostname: testing
> container_name: web
> ports:
> - "80:80"
> - "443:443"
> - "8025:8025"
> volumes:
> - ./:/sites/localhost/html/public/
> - ./xdebug.ini:/etc/php83/conf.d/xdebug.ini
> environment:
> DATABASE_URL: "mysql://user:password@db:3306/tont_db"
> command:
> [ "sh", "-c", "mkdir -p /sites/localhost/logs/ && chown -R www-data:www-data /sites/localhost/logs &&/tmp/start.sh"]
> depends_on:
> - db
>
```
my xdebug.ini file.ini

```>
> zend_extension=xdebug.so
>
> ##############################################
> # common settings
> ##############################################
>
> # values: off,develop,coverage,debug,profile,trace,gcstats
> # reference: https://xdebug.org/docs/all_settings#mode
> xdebug.mode = develop,debug,coverage
>
> # enable on all requests vs. trigger
> # values: yes,no,trigger,default
> xdebug.start_with_request = yes
>
> # only if trigger mode
> xdebug.trigger_value = ""
>
> # log
> xdebug.log = /sites/localhost/logs/xdebug.log
> xdebug.log_level = 7
>
> ##############################################
> # debugger
> ##############################################
>
> xdebug.discover_client_host = 1
> xdebug.client_host = xdebug://gateway
> xdebug.client_port = 9003
> xdebug.connect_timeout_ms = 1000
>
> ##############################################
> # profiler
> ##############################################
>
> xdebug.output_dir = "/sites/localhost/logs/"
> xdebug.profiler_output_name = "cachegrind.out.%s.%H"
>
> # misc.
> xdebug.profiler_append = 0
>
```
this is docker terminal

```>
> /sites # php -v
> PHP 8.3.22 (cli) (built: Jun 3 2025 22:38:37) (NTS)
> Copyright (c) The PHP Group
> Zend Engine v4.3.22, Copyright (c) Zend Technologies
> with Zend OPcache v8.3.22, Copyright (c), by Zend Technologies
> with Xdebug v3.4.3, Copyright (c) 2002-2025, by Derick Rethans
>
```
so it should be running and I am able to listen right?

when I try to access this page:
[some code](https://i.sstatic.net/gwMe81MI.png)

I get:
[errors](https://i.sstatic.net/cX5JjBgY.png)

a full screan:
[full screen](https://i.sstatic.net/Jpp3ErR2.png)

and this is my phpstorm
[debug](https://i.sstatic.net/fCOCT76t.png)
[debug config](https://i.sstatic.net/jGr5woFd.png)
[xdebug settings](https://i.sstatic.net/GP6uG1AQ.png)
[php server settings](https://i.sstatic.net/LVsiHzdr.png)

and this is all xdebug output in the file /sites/localhost/logs/xdebug.log

```>
> /sites # cat /sites/localhost/logs/xdebug.log
> [18] Log opened at 2025-10-13 20:28:22.987363
> [18] [Config] WARN: Not setting up control socket with default value due to unavailable 'tsc' clock
> [18] [Step Debug] INFO: Checking for client discovery headers: 'HTTP_X_FORWARDED_FOR,REMOTE_ADDR'.
> [18] [Step Debug] INFO: Checking header 'HTTP_X_FORWARDED_FOR'.
> [18] [Step Debug] INFO: Checking header 'REMOTE_ADDR'.
> [18] [Step Debug] INFO: Client host discovered through HTTP header, connecting to 192.168.65.1:9003.
> [19] Log opened at 2025-10-13 20:28:23.410216
> [19] [Config] WARN: Not setting up control socket with default value due to unavailable 'tsc' clock
> [19] [Step Debug] INFO: Checking for client discovery headers: 'HTTP_X_FORWARDED_FOR,REMOTE_ADDR'.
> [19] [Step Debug] INFO: Checking header 'HTTP_X_FORWARDED_FOR'.
> [19] [Step Debug] INFO: Checking header 'REMOTE_ADDR'.
> [19] [Step Debug] INFO: Client host discovered through HTTP header, connecting to 192.168.65.1:9003.
> [18] [Step Debug] WARN: Could not connect to client host discovered through HTTP headers, connecting to configured address/port:
xdebug://gateway:9003.
> [18] [Step Debug] WARN: Creating socket for 'xdebug://gateway:9003', getaddrinfo: Invalid argument.
> [18] [Step Debug] ERR: Could not connect to debugging client. Tried: 192.168.65.1:9003 (from REMOTE_ADDR HTTP header), xdebug://gateway:9003 (fallback through xdebug.client_host/xdebug.client_port).
> [18] Log closed at 2025-10-13 20:28:23.996907
>
> [19] [Step Debug] WARN: Could not connect to client host discovered through HTTP headers, connecting to configured address/port: xdebug://gateway:9003.
> [19] [Step Debug] WARN: Creating socket for 'xdebug://gateway:9003', getaddrinfo: Invalid argument.
> [19] [Step Debug] ERR: Could not connect to debugging client. Tried: 192.168.65.1:9003 (from REMOTE_ADDR HTTP header), xdebug://gateway:9003 (fallback through xdebug.client_host/xdebug.client_port).
> [19] Log closed at 2025-10-13 20:28:24.426456
>
```
I really have no idea what should I do

I am running fedora 42

https://redd.it/1o5wruy
@r_php
Question: PHP-FPM Tuning on Synology NAS

Primary use case is a single user of a CPU-intensive NLP (natural language processing) PHP application. Environment is a DS1825+ with 16GB memory - Web Station, Nginx, PHP 8.2. What changes to Synology's FPM settings, shown below, are recommended?

\- FPM Mode: Static (vs. Dynamic, On Demand)

\- Max Processes: 20

\- Max Servers: 2

\- Min Spare Servers: 1

\- Max Spare Servers: 3

We are currently optimizing the PHP code for performance; but we also wanted to look at FPM tuning, PHP Core settings, and other system-level tuning for any possible incremental improvements.

This is outside our area of expertise, so... Thanks for any insights.



https://redd.it/1o5uyhf
@r_php
Consolidating hosting

Hey all, I was wondering if this makes sense or if someone knows a better option. But currently I’ve got shared hosting, email and domains on hostmonster, bluehost, and ionos (I know it’s insane but it was all bought a long time ago when I first got into php and then I started getting into .net so at the time it had to be windows but now it doesn’t really make sense because it’s all Linux now anyways. Also I’m kinda into Laravel right now so I’ll be dropping all my .net stuff and just going with Laravel (php). I’ve also got some domains on namecheap.

Anyways I want to consolidate. I don’t really have a need for something that takes lots of traffic and space for everything just a server that can run Laravel and send out email. All small projects. I was thinking of moving all my hosting to the smallest droplet on DigitalOcean because that’s what most Laravel users suggest. For my domains I was thinking of moving them all to porkbun because I see a lot of love for them and also a lot of people are turning away from namecheap. But I don’t really know what to do with my email, either somehow setup self hosted email on Digital Ocean or pay porkbun $2 for each email. Paying per email was kind of a shock to me because I’m use to getting unlimited emails included in the shared hosting and $2 seems like a lot for just 1 email account, I use several.

https://redd.it/1o5spn3
@r_php