All Questions
Tagged with php-frameworks or php
1,463,415 questions
1
vote
0
answers
53
views
Symfony 5 make:entity property relation issue
In Symfony 5, I'm trying to add a new Entity with a relation in it but I think I don't use the command like I should...
When I want to create an Entity I do this:
$ bin/console m:e myNewEntity
Then, ...
-1
votes
0
answers
68
views
Moodle gradebook stuck on "Recalculating grades" forever despite needsupdate=0 and cron running correctly [closed]
I'm experiencing a persistent gradebook issue on our Moodle site and have exhausted most standard fixes. Hoping someone here has encountered this before.
Environment
Moodle version: 4.1.2
PHP: 8.2
...
-3
votes
0
answers
102
views
PHP Cli Script finishes with SEGFAULT (FreeBSD & PHP 8.3.30) [closed]
When running a PHP CLI command like:
php bin/magento cache:flush
We get a segmentation fault at the end, when the script finishes.
# php bin/magento cache:flush
Flushed cache types:
config
layout
...
Best practices
1
vote
7
replies
111
views
input text Remove operation by condiiton
I have a operation logic to do in two simples steps into a input value. For me it's like a input cleaning operation I would love to do.
Inside of my input I have some blocks of numbers, for instance: ...
2
votes
0
answers
152
views
PHP Script not timing out while using curl_exec( )
I have a php shell script that runs at scheduled intervals via launchd. The script has a 2 minute php timeout, but I understand that time spend in curl_exec( ) doesn't count towards that. But I also ...
Best practices
0
votes
4
replies
96
views
Simple PHP API example
<?php
include "./db_functions.php";
$method = $_SERVER["REQUEST_METHOD"];
$uri = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
$uri = explode("/", $...
Best practices
0
votes
7
replies
104
views
Simple SQL (Get and Edit Data)
<?php
// get data or modify data
function getData($sql){
$db = new mysqli("localhost", "root", "", "database");
if($db->...
1
vote
1
answer
53
views
CodeIgniter cron endpoints: best practice for daily scheduled execution, date-window processing, and token-gated stage 2
I’m working on a CodeIgniter (PHP) app with a 2-stage batch process:
Cron 1 (syncAndPrepareQRTokens)
sync eligible members to member_benefits
generate qr_code_token
Cron 2 (execute)
generate PDF + ...
Best practices
4
votes
1
replies
58
views
Use PHP TS as Apache module and FCGI
php.net site write:
NTS builds are for single-threaded use cases, typically PHP running
via FastCGI or on the CLI. TS builds support multithreaded SAPIs and
are intended for PHP loaded as a web ...
-2
votes
0
answers
64
views
PHP strpos() cannot find string in curl_getinfo() result [closed]
This is a part of my code:
$content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
fwrite($file, $content_type);
if(strpos($content_type, "text/html") === false)
{
// do some things
}
.....
Best practices
2
votes
14
replies
231
views
Does my code look secure? And How do I prevent people from entering a page?
To practice php I created a login system that only works for 1 user, and if you type in the wrong username/password it will kick you out. If you type the right one it sends you to a devtools.php. I'm ...
Advice
4
votes
6
replies
91
views
Dashboard Setup: Same Repo or Separate Project?
I finished coding my project, but it requires a dashboard. What should I do? Should I create a separate repository or project for the admin dashboard, or use a monorepo?
Best practices
3
votes
5
replies
134
views
How to avoid page rendering delays in PHP and JavaScript web development?
fellow developers!
I’ve been working on web development projects using PHP Native for backend and Vanilla JavaScript for frontend. Sometimes, I notice that my web pages take a noticeable time to ...
-1
votes
1
answer
146
views
Why is my PHP query string malfunctioning?
I am writing a simple web-app to display flashcards using PHP, SQL and HTML.
To show the cards currently created I have a page called view_cards.php which loads with a query string comprising the ...
-4
votes
2
answers
76
views
Append instances of specific word in string with incrementing integer
I have some text like this:
Lorem ipsum THIS dolor sit THIS amet, consectetur THIS adipiscing elit.
and it needs to be like this:
Lorem ipsum THIS1 dolor sit THIS2 amet, consectetur THIS3 adipiscing ...