/r/PHPhelp
This subreddit is for anyone who has questions about their PHP code.
Please read and understand the rules before creating a post.
Post specific problems or questions you have about PHP or your code.
Review our github to see if your question already has a great answer.
If someone answers your question, please mark your post as SOLVED.
/r/PHPHelp RULES:
1. Help us help you! Provide details about your question and be as specific as possible. When supplying code, preferably use PasteBin or similar.
2. Be nice Golden rule, people. If you believe someone is wrong, kindly inform them why you think so. It's possible you are also wrong. BE NICE!
3. Participate Posts that are only intended to get others to solve your problem add nothing to the community. Actively participate when you make a post by answering questions and sharing solutions.
4. Use a meaningful title Titles like: "PHP Help", "Help please", "Beginner question", or "I need some help with resolving this issue" are not good and not meaningful. Please include relevant info.
5. Don't delete an answered post People may be searching to solve a similar problem in the future. Don't take the provided answers away from them!
6. No malicious/illegal software Don't ask for help with phishing software, for example.
7. Self-promotion and/or linkdropping rules Our community adheres to the Reddit Self-Promotion Guidelines. Please become familiar with these guidelines as we, as moderators, will use them to remove content that we deem to violate these guidelines.
8. No job postings (For Hire or Hiring)
9. MARK YOUR POST AS SOLVED If your post has been solved, mark it as so by clicking Flair
-> Solved
.
CODE FORMATTING:
For inline code, use `backticks` to look like this
.
For a moderate amount of code, put it on separate lines, and prepend each line with four spaces, like this:
<?php /* code goes here */ ?>
For a lot of code, use PasteBin or something similar.
Upcoming PHP Conferences:
For a full list of conferences see the list on php.net.
Learning:
Examples:
Related subreddits:
/r/PHPhelp
I'm looking for something that livewire does, but more barebone. The functionality im looking for is to be able to register an action during the page load, and make it accessible through an action url that i can call from js. FilamentPHP has something like this for table actions, where you define your actions as callbacks, and can call them from the table. I also managed to do something like this by serializing closures, but with that you lose support for debugging with break points... so i would like to do something similar to what filamentphp does. Does such library exists that doesnt do a million other things, just this one thing?
In past years, I tried to set up a complete programming environment for PHP using a Virtual Machine running Ubuntu 20.04, but I wasn’t successful. After that, I spent a lot of time attempting to use Docker, hoping it would solve my problem, but I didn’t succeed there either.
All I need is to be able to program with PHP locally and use tools like Xdebug on VSCode, where I can start web development from scratch without frameworks to gain a better understanding of the components in PHP-based websites. I haven’t had any issues using Laravel, but since it’s a framework, I prefer programming without one to better practice design patterns and other patterns for learning purposes.
Any suggestions on how I could resolve this issue successfully soon?
Greetings,
Let's start with the basics. I'm a self-taught junior PHP developer. Recently I have failed a couple of interviews mostly because everyone wanted some reference projects. Unfortunately, I cannot provide any since I had a couple of jobs, but the contracts do not allow me to show the code. I decided to create a couple of projects that I can show as reference, with the context of why these projects have AI-generated frontends, simplified functionality, etc.
I would really appreciate it if you could give me a code review or your opinion about these projects. I want to improve my skills.
Links:
I’m currently benchmarking popular PHP routers and have built a benchmark tool that makes it easy to add more Composer packages and run multiple test suites.
Each test runs PHP 8.4 CLI, calling a PHP-FPM server with opcache enabled via curl to better simulate a real-world scenario. The tool automatically orders results, calculates median times from 30 test runs, and updates a README file with the results.
Many benchmarks simply create a router, add routes, and then measure lookup speed for 1,000 routes. However, real-world applications often define a fixed set of routes and repeatedly call only one or a few paths. Because of this, I think both initial setup time and per-route resolution speed are important to measure.
What metrics and tests would you like to see in a PHP router benchmark? Would you be more interested in functionality, raw speed, setup time, memory usage, or something else?
Currently I have FastRoute, PHRoute, Rammewerk and Symfony. Any more to add?
I have a symfony application and getting a POST request from a remote service. When receiving with an Apache webserver with php 8.3, i can get the POST data with $data = file_get_contents("php://input").
It's not working on a Nginx webserver. then $data is empty. The difference is apache PHP is a module, on nginx it's fpm.
Sorry if i should ask this in r/nginx
Hi there, want your help to bypass some time verification in order to get the flag. Here is the code:
<?php
// PHP 7.0 used
$flag = "REDACTED";
$minimum_time = 3600 * 24 * 200;
$maximum_time = 3600 * 24 * 400;
$time = $_GET['time'];
if(isset($time)){
if(!is_numeric($time)){
echo '<script>alert("Only number")</script>';
} else if($time < $minimum_time){
echo '<script>alert("Too short")</script>';
} else if($time > $maximum_time){
echo '<script>alert("Too long")</script>';
} else{
sleep((int)$time);
echo $flag;
}
}
highlight_file(__FILE__);
?>
I'm getting some weak warnings from PHPStorm on unneccessary curly braces.
Example:
$colour = "blue";
$sample = "The colour is {$colour}";
I prefer to retain the brackets for readability and was about to turn off the inspection but I thought I better check first in case there's something I'm not aware of.
Am I right in thinking it's a superfluous warning?
Hi long story short, i am c# developer (backend, desktop app) with react as fronted, but since most of user on the deep web disable javascript react doesnt work, so i am interesting in to do a website with laravel (i am curretnly learn it) but i would like to know if laravel blade will work on tor sites (for the fronted)? or is not better to use over engineer i mean not to use frameworks to built a tor site, just do it old fashion. For example i like the forum of phpbb i know this forum script works without problems on the deep web.
Hi guys, anyone knows a backend as service similar to Directus but made in php? The version 8 was in php, then they decided to move to laravel (but unfortunately choosed express instead)
I have installed php 7.4 on my server and, for database management, I use php my admin. Trying to connect to the IP/phpmyadmin page I receive this message:
Not Found The requested URL was not found on this server. Apache/2.4.62 (Debian) Server at 192.168.1.9 Port 443
I tried installing php 7.4 and phpmyadmin on another machine with the same result... could you tell me how to do it? I need to have phpmyadmin available again on the main machine before I can upgrade to php8
I'm building out a system, that allows people to add notes to modules (clients/projects/etc), and we would like to have "history" revisions. I have that part ok, but was looking for an existing code that will highlight the difference. I started playing with it, but the trickiness of where the differences can be, I'm ready to give up on the idea unless I can find something.
Example:
I will get onto this task after my meeting with the idiot boss
then rethinks, and edits to
I will get on this task after my meeting with the boss tomorrow.
I would like it to highlight as (just using bold for here)
Rev 1: I will get onto this task after my meeting with the idiot boss *.
Rev 2: I will get on this task after my meeting with the * boss tomorrow.
For reference, my fav compare tool is WinMerge, not looking for that complexity, but just something that makes it a little easy to notice the changes between two version.
Thanks.
Hello, anywhere where is description like in tasks etc, when i write there in Czech some special characters, after saving these characters changes to HTML entities. In subject it works. How to fix it?
ě -> ě
š -> š
č -> č
ř -> ř
ž -> ž
ý -> ý
á -> á
í -> í
é -> é
ú -> ú
ů -> ů
This article is what I'm using to put videos on the front of 4 forms I have on my website: https://wpforms.com/developers/how-to-add-a-video-before-your-form/
The only troubler I'm having is trying to figure out if I do it in one snippet, or four. I have tried numerous ways of doing it, but I honestly do not know php at all.
Can someone help me with the code as far as how to make it so I can post a different video for the beginning of four different forms?
Also, I can get it successfully on there and showing with just one video. It looks great. But then when I try to copy and paste stuff to make 4 it gets all messed up. Thank you in advance!
/**
* Output something before your form(s).
*
* u/link https://wpforms.com/developers/how-to-add-a-video-before-your-form/
*/
function wpf_dev_frontend_output_before( $form_data, $form ) {
// Optional, you can limit to specific forms. Below, we restrict output to
// form #999.
if ( absint( $form_data[ 'id' ] ) !== 999 ) {
return;
}
// Add the link of your video here within this iframe code
_e( '<p><iframe src="https://www.youtube.com/embed/eiQ3viAGung" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p>', 'plugin-domain' );
}
add_action( 'wpforms_frontend_output_before', 'wpf_dev_frontend_output_before', 10, 2 );
Hello everyone! i have fair amount of experience with Laravel and php. But I seem to fail to answer some typical PHP questions at interviews. I would love if you could suggest some books for me to get under the PHP hood?
It would be great if the book covered both PHP 7 and 8
Edit 1: Forgot to mention I use VSCODE with PHP devsense extension as formatter and run it on Five server, as Live server didn't work out for me. I think that I have put the right paths in PHP:executeable: C:\xampp\php\php.exe and in the PHP:Ini : C:\xampp\php
Hi everybody,
I'm new to the PHP world and I'm in the progress of taking Edwin Diaz PHP for beginners cms project course. I have found a way to fix other things i had trouble with doing the course, but this I just havent been able to find a solution to.
My problem is here, that everytime i followed the courses exact same code with the superglobals, it always gives me an error stating this: "stderr: PHP Warning: Undefined array key "REQUEST_METHOD" in C:\xampp\htdocs\demo\process.php on line 2"
This is my code:
index.php:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Validation</title>
</head>
<body>
<form action="process.php" method "POST">
<input name="username" type="text" placeholder="Enter username">
<input name="password" type="password" placeholder="Enter password" asterisk>
<input type="text" name="email" placeholder="Enter email"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
process.php:
<?php
if($_SERVER["REQUEST_METHOD"] == "POST") {
$username = $_POST["username"];
$password = $_POST["password"];
echo "Username: $username <br> Password: $password";
}
?>
Hi guys,
As the title says, I am running Laravel 11 + Inertia (React) on coolify. I've been able to deploy the app successfully, but the server keeps restarting. With an SPA, it works but SSR fails and I don't know what the problem is.
Navigating to the page shows a 404 after deployment. I'd appreciate any help right now as I've been on this for a while. Here's my nixpacks.toml for context:
[phases.setup]
nixPkgs = ["nginx", "python311Packages.supervisor", "..."]
[phases.build]
cmds = [
"mkdir -p /etc/supervisor/conf.d/",
"mkdir -p /etc/nginx/",
"cp $(dirname $(dirname $(command -v nginx)))/conf/mime.types /etc/nginx/",
"cp /assets/fastcgi_params /etc/nginx/",
"cp /assets/worker-*.conf /etc/supervisor/conf.d/",
"cp /assets/supervisord.conf /etc/supervisord.conf",
"cp /assets/nginx.template.conf /etc/nginx/nginx.conf",
"chmod +x /assets/extra.sh",
"ln -s /app/storage/app/public /app/public/storage",
"...",
"/assets/extra.sh"
]
[phases.postbuild]
cmds = ["php /app/artisan migrate --force"]
dependsOn = ["build"]
[staticAssets]
"extra.sh" = '''
#!/bin/bash
# Enable OPcache
PHP_INI_PATH=$(php -i | grep '/php.ini' | awk '{print $6}')
echo 'php path found: ' $PHP_INI_PATH
echo opcache.memory_consumption=256 >> "$PHP_INI_PATH"
echo opcache.interned_strings_buffer=64 >> "$PHP_INI_PATH"
echo opcache.max_accelerated_files=32531 >> "$PHP_INI_PATH"
echo opcache.validate_timestamps=0 >> "$PHP_INI_PATH"
echo opcache.enable_cli=1 >> "$PHP_INI_PATH"
'''
"supervisord.conf" = '''
[unix_http_server]
file=/assets/supervisor.sock
[supervisord]
logfile=/var/log/supervisord.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=info
pidfile=/assets/supervisord.pid
nodaemon=false
silent=false
minfds=1024
minprocs=200
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///assets/supervisor.sock
[include]
files = /etc/supervisor/conf.d/*.conf
'''
"worker-laravel.conf" = '''
[program:worker-laravel]
process_name=%(program_name)s_%(process_num)02d
command=bash -c 'exec php /app/artisan horizon'
autostart=true
autorestart=true
startsecs=0
stopwaitsecs=3600
stdout_logfile=/app/storage/logs/worker-laravel.log
stderr_logfile=/app/storage/logs/worker-laravel.log
'''
"worker-inertia-ssr.conf" = '''
[program:inertia-ssr]
process_name=%(program_name)s_%(process_num)02d
command=bash -c 'exec php /app/artisan inertia:start-ssr'
autostart=true
autorestart=true
startsecs=10
stopwaitsecs=10
stdout_logfile=/app/storage/logs/inertia-ssr.log
stderr_logfile=/app/storage/logs/inertia-ssr.log
numprocs=1
'''
"nginx.template.conf" = '''
worker_processes auto;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name localhost;
root /app/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
}
}
'''
"fastcgi_params" = '''
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REDIRECT_STATUS 200;
'''
Hey everyone,
I’m working on a Laravel project where users can upload videos. To optimize performance, I’m looking to compress videos directly in the user’s browser before sending them to the backend. I’m considering using ffmpeg.wasm for this, with Livewire 3.
Has anyone integrated ffmpeg.wasm into a Laravel project for client-side video compression? If it’s not feasible, are there any alternative libraries or approaches you’d recommend for handling this?
I’ve been chasing a file descriptor leak in my use of the SQlite3 extension. This cropped up in a busy php_fpm based web site. I wasn’t close()
ing SQLite3 (trying to accommodate an ill-behaved but popular WordPress plugin).
I think the problem is fixed. But I’d love to convince myself.
Is there a way in php to find out the current number of file descriptors in use in the process? If this number climbs over time I know I have a leak.
Someone can help me?
I’m facing an issue related to a URL parameter, and after running all possible tests, I believe the problem is something internal.
Here’s the situation: when I access a URL on my site that includes the parameter ?name=
, instead of treating it as a parameter, it redirects to another page on the site, as if the name
parameter is being used to search for another page.
I need this parameter to stop behaving this way because when someone accesses my site, completes the registration form, and is redirected to a payment page, the name and email fields are automatically populated using the name
parameter.
Example: If someone accesses the link:https://engclass.com.br/workshop-engenheiro-perito?email=teste@teste.com&name=felipe
They are redirected to a 404 page instead of the correct page:https://engclass.com.br/workshop-engenheiro-perito
.
On the other hand, if someone accesses:https://engclass.com.br/workshop-engenheiro-perito?email=teste@teste.com
(without the name
parameter), they are correctly taken to the intended page:https://engclass.com.br/workshop-engenheiro-perito
.
For instance, if I access:https://engclass.com.br/workshop-engenheiro-perito?email=teste@teste.com&name=curso-a
It redirects to:https://engclass.com.br/curso-autocad-essencial/?email=teste%40teste.com
.
Notice that this behavior is entirely because of the name
parameter.
I need the name
parameter to work as a normal parameter instead of redirecting to another page. Can you help me fix this?
```
if ($_REQUEST['action'] == 'registerNewComplain') {
try {
// make postData array for model
$postData = [
'complain_number' => $_POST['hidden_complaint_number'] ?? '',
'manual_complaint_number' => $_POST['complaint_number'] ?? '',
'lineman_name' => $_POST['lineman_name'] ?? '',
'customer_name' => $_POST['name'] ?? '',
'customer_id' => $_POST['customer_id'] ?? '',
'phone' => $_POST['phone'] ?? '',
'name' => $_POST['name'] ?? '',
'address' => $_POST['address'] ?? '',
'comment' => $_POST['comment'] ?? [],
'complian_date' => $_POST['complian_date'] ?? date("d/m/Y"),
'complian_time' => $_POST['complian_time'] ?? '',
'area_type' => $_POST['area_type'] ?? null,
'breakdown_type' => $_POST['breakdown_type'] ?? null,
'k_number' => $_POST['k_number'] ?? '',
'other_comment' => $_POST['other_comment'] ?? '',
'cc_complaint_number' => $_POST['cc_complaint_number'] ?? '',
'subdivision_lineman' => $_POST['subdivision_lineman'] ?? '',
'subdivision_id' => '',
'lineman_phone' => '',
'area_id' => '',
'lineman_id' => $_POST['assignee_id'] ?? '',
];
// fetch lineman related columns data using its id
if (!empty($postData['lineman_id'])) {
$lineman = $UserDAO->getUserById($postData['lineman_id']);
$postData['subdivision_id'] = $lineman['subdivision_id'];
$postData['area_id'] = $lineman['area_id'];
$postData['lineman_phone'] = $lineman['phone'];
}
$date_split_array = explode('/', $postData['complian_date']);
$complain_date = $date_split_array[2] . '-' . $date_split_array[1] . '-' . $date_split_array[0];
if (!empty($postData['complian_time'])) {
$complain_time = date("H:i:s", strtotime($postData['complian_time']));
$complain_date_time = $complain_date . ' ' . $complain_time;
} else {
$complain_time = '';
$complain_date_time = $complain_date . ' ' . date("H:i:s");
}
$postData['complain_date_time'] = $complain_date_time;
// provide data to model
$status = $ComplainDAO->registerNewComplain($postData);
if ($status) {
if (SMS == '1' && CUSTOMER_SMS == '1' && !empty($postData['phone']) && !empty($postData['cc_complaint_number'])) {
$SMSController->customerComplainMessage(
$postData['manual_complaint_number'] ?: $postData['complain_number'],
$postData['phone']
);
}
if (SMS == '1' && COMPLAINT_CENTER_SMS == '1' && !empty($postData['lineman_phone'])) {
$SMSController->linemanComplainMessage(
$postData['manual_complaint_number'] ?: $postData['complain_number'],
$postData['lineman_phone'],
$postData['customer_name'],
$postData['address'],
$postData['phone']
);
}
// send push notification to lineman device
$userArray = $UserDAO->getUserById($postData['lineman_id']);
if (!empty($userArray['gcm_id'])) {
$NotificationController->sendNotofication(
$userArray['gcm_id'],
'You have a new complain. Please try to sort out ASAP',
'आपको एक नई शिकायत सौंपी गई है, कृपया जल्द ही ठीक करने का प्रयास करें'
);
}
echo 'true';
} else {
echo 'false1';
}
} catch (Exception $e) {
echo "Error occurred. Please contact support.";
error_log("Error: " . $e->getMessage() . " File: " . $e->getFile() . " Line: " . $e->getLine());
}
}
This is going to be base for other controllers also all models will recieive a array rathan than individual values as i find it easy to debug is it good approach or have any side effect
In my php project i serve files from a slim endpoint behind an nginx server with rate limiting setup.
limit_rate 10M;
sendfile on;
tcp_nopush on;
@ a time i only had php point to the file and nginx handled the download. in my current setup php is serving the file using get_file_contents and the rate limit is no longer working. I have tried a a couple ways of serving the file in php code with varying results. endpoint in question
$response->getBody()->write(file_get_contents($file)); // no rate limit, correct header
$response->getBody()->write(readfile($file)); // wrong content type header, rate limit works
readfile($file); // wrong header, limit works
my chatgpt conversation has went circular. it insists replacing the file_get_contents line with readfile is the answer. it works to a degree. the limit then works but the content-type header is reported as text/html and gzip compression kicks in and i lose progress bar in js. i also attempted to do rate limiting in php but got poor response time when files got bigger. thanks
Edit: the answer for me was a nginx config issue and not directly related to php code. I had the rate settings in the root location block of nginx config.
location / {
by putting the rate settings in the php config block of nginx the rate limit works.
location ~ \.php$ {
Thanks again.
Is it possible to autowire interfaces in Laravel? I thought this was introduced with Laravel 11, but i'm still manually adding bindings in the AppServiceProvider
, like this:
public function register(): void
{
$this->app->bind(LoggerHandler::class, LoggerService::class);
}
Thanks for your help
I have a website and when clients try to subscribe or send me their details via website I can't see their response how can I fix it?
Hi everyone! I need some advice regarding a PWA project. The backend runs a PHP-based API that I wrote to provide the PWA with data. The API access requires authentication and I would like a user to stay authenticated after a login for a week at max during inactivity.
Currently, I have solved this using JWT. During the validity of the JWT access token, I rely on data stored in the JWT: a user ID and a club ID (indicating membership), to avoid having to check which club the user is an active member of.
Recently, I've read a lot of articles on how JWT is bad practice and often misused and that session-based auth is a better solution. I am wondering now if I should move to that, especially having the following requirements in mind:
Are these requirements better handled using session-based authentication? I am specifically interested in the implications regarding security and flexibility/UX.
Thanks in advance for your insights! 🙏
I have a class with this property
class MyClass {
public array $apps = [];
}
I want to describe the shape of this property, like this:
class MyClass {
/** @var array<string> */
public array $apps = [];
}
But PHPStan is still throwing an error when using this property as a $needle, somewhere in the code (outside of the class):
:19 Parameter #2 $needle of function str_starts_with expects string, mixed given.
🪪 argument.type
What do I do wrong? How to define the shape of class property?
Hello,
Ive added this code to Wordpress function to access a Google sheets cell and print it in my website.
However, I have an error showing frontend saying : Trying to access array offset on value of type null in... eval()'d code on line 12. I've higlighted the line.
Returning value works.. but I still get this error from time to time. Not all the time tough.
I'm calling the a cell value with this shortcode: [get_sheet_value location='named_call_id']
Example of returned JSON value before getting cleaned by the function is:
{
"range": "'NamedCell'!F8",
"majorDimension": "ROWS",
"values": [
[
"189"
]
]
}
Here's the full code. It has been copied from there: https://www.wp-tweaks.com/display-a-single-cell-from-google-sheets-wordpress/
--
function sheet_value_shortcode($atts) {
$API = '[my_api_key]';
$google_spreadsheet_ID = '[my_spreasheet_id]';
$api_key = esc_attr( $API);
$location = $atts['location'];
$get_cell = new WP_Http();
$cell_url = "https://sheets.googleapis.com/v4/spreadsheets/$google_spreadsheet_ID/values/$location?&key=$api_key";
$cell_response = $get_cell -> get( $cell_url);
$json_body = json_decode($cell_response['body'],true);
$cell_value = $json_body['values'][0][0];
return $cell_value;
}
add_shortcode('get_sheet_value', 'sheet_value_shortcode');
For a long time, I have noticed Windows PHP exec() will run the command inside the Command Prompt. If I want to run a PowerShell command, I will need to do it like this:
exec("powershell [my powershell command here]");
This works, but it is tedious to struggle with Command Prompt having different escaping rules than the PowerShell. This is also slow because a new PowerShell instance needs to be started every time I do it like this.
Is there any way for me to somehow specify to use the PowerShell to run my commands? The plan is to run some simple PS commands on the PS runtime, so best if it does not involve creating dedicated PS script files for this.
Hey everyone, a few days ago I decided to move a php app from Bluehost to digital ocean so I downloaded the db and imported it using phpmyadmin and ran it. But something odd is happening, everything gives me random sql errors telling me to check my syntax , and stuff that would load on the Bluehost site won't on the one running on digital ocean. I made sure I'm using the same database , version and all that, I've been trying to fix it for awhile now but I'm no closer to understanding what's happening. Does anyone have any idea what the issue is and how to solve it?
How can I decouple a method from a request? I’d like to pass a generic object (e.g., a DTO) instead of being tied to a request. This way, I could call that specific method both from an API and from a command. What would be the best approach to achieve this? Thank you