Questions tagged [php]
The php tag has no summary.
304 questions
0
votes
0
answers
52
views
Cannot install Craft CMS 3 on Ubuntu 24.10
I've just installed a droplet from DigitalOcean and installed Apache, PHP, MySQL and configured virtual hosts on the server and installed composer. I've installed craft via the command line with no ...
0
votes
1
answer
267
views
How do I query a Matrix field in v5, in a module (php)?
I have a module that mainly does normalization of data before sending it to the frontend through Element API. We're running Craft in headless mode.
Previously, I have used this code to query a Matrix ...
2
votes
1
answer
203
views
PHP invalid syntax error during Craft 5 Installation
I am trying to install Craft 5, but the Composer-based installation is throwing several errors at the end. These errors appear after all packages seem to be successfully downloaded and installed by ...
1
vote
1
answer
171
views
Looking for best practices deploying to Azure Web App
I have a client who is requiring me to move a production site into his Azure environment, and rather than just making a VM available to me, he's provided me with a Web App with a PHP runtime. I'm not ...
0
votes
2
answers
110
views
Craft2 migration to new server - storage isn't writable by PHP. Please fix that
I am migrating 2 separate Craft2 websites (in IIS v7) to a new webserver.
I used Microsoft's WebDeploy utility to move the site files and their settings, and then I exported the dbs from each site, ...
1
vote
1
answer
223
views
Craft Queue in Laravel Forge: Scheduler or Daemon?
I'm a little confused about the best way to setup server processes using Laravel Forge with Craft CMS (4.8.0).
Currently we are running the following Daemon:
/usr/bin/php /home/forge/domain.com/craft ...
3
votes
2
answers
215
views
Unable to find custom template when using a console controller inside a module
I'm creating my first module. Inside this module, I check a few entries for some conditions, and if all conditions are met, I want to send out a personal email.
Everything worked, but I wanted to ...
2
votes
1
answer
996
views
PHPdotEnv upgrade not working
Updating my Craft CMS website to Craft 3.8 on PHP 8.1 yielded the first of its kind: the fatal deprecation error that would not allow the migration to continue. Turns out, PHPdotEnv v 2.8 is too old:
...
0
votes
1
answer
140
views
Error on plugin settings page: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
I've installed the latest CraftCMS version via composer.
When I'm visiting the plugins settings page (/web/admin/settings/plugins), I get the following error message:
preg_replace(): Passing null to ...
2
votes
1
answer
187
views
How to Escape a Query Parameter
Extremely not a PHP developer here but trying to set up a simple API with Element API. I've got the basics working to filter my entry results based off of a query URL parameter:
use craft\elements\...
1
vote
1
answer
402
views
Updated to PHP version 8.1.22 and one of my Craft 3 sites is getting a critical error
I upgraded my server to PHP 8.1.22 in order to start a new Craft 4 site, and one (but not all) of my existing Craft 3 (3.6.17) sites is giving me the following error. How do I resolve this error? See ...
1
vote
1
answer
441
views
Excluding entries in an entry query with an array of IDs (PHP)
This seems more like a PHP question than a Craft CMS question, but since it's related to an entry query I'm trying to create I figured someone from the Craft community might know. I'm having trouble ...
0
votes
1
answer
60
views
Site breaking when I call a custom module up on app.php file
My Craft CMS version 3 site is breaking when I boostrap a custom module up on app.php file.
The code looks like this:
<?php
use craft\helpers\App;
return [
'id' => App::env('APP_ID') ?: '...
2
votes
1
answer
428
views
How to use ajax call to retrieve data from craft cms entries to use in php application
I'm building a static webpage with php and Javascript. I have setup all my data in craft cms entries. I want to use ajax to retrieve the data from craft and just display it on my webpage. How do I do ...
1
vote
1
answer
114
views
Craft CMS 2 - Exporting entity issue
I installed this https://github.com/boboldehampsink/export plugin but getting error during exporting entities regarding to "count(): Parameter must be an array or an object that implements ...