Hope Fund loan app customer. care. helpline. NUMBER -)7044685524-//-9124463406-Call.Hope Fund loan app customer. care. helpline. NUMBER -)7044685524-//-9124463406-Call.Hope Fund loan app customer. care. helpline. NUMBER -)7044685524-//-9124463406-Call.Hope Fund loan app customer. care. helpline. NUMBER -)7044685524-//-9124463406-Call.
Category: PHP
Category Added in a WPeMatico Campaign
Laravel PDF (Spatie) + Puppeteer + Forge: “No usable sandbox” error in production
I’m using the spatie/laravel-pdf package (which wraps Browsershot + Puppeteer) to generate PDFs in my Laravel 12 project.
It works perfectly on my local machine, but when I deploy it to my Forge provisioned Ubuntu 24.04 server, I get this error when trying to generate a PDF:
Error: Failed to launch the browser process!
[xxxx/FATAL:zygote_host_impl_linux.cc(132)] No usable sandbox!
Best Way to Add a Lightweight Forum to WooCommerce Site Without Slowing It Down? [closed]
I’m running a WooCommerce site.
I want to integrate a lightweight discussion forum where users can:
-
Share reviews
-
Post product questions
-
Engage in shoe-related topics
I’ve considered:
- bbPress (seems a bit heavy and old)
- wpForo (too feature-rich for what
- I need) Creating a custom CPT + comments + simple front-end template
My main concern is:
- Keeping performance high (Core Web Vitals are key)
- SEO indexing of forum threads
- Clean integration with existing WordPress + WooCommerce setup
Has anyone built a minimal discussion area into a WooCommerce store?
Any modern solutions or lightweight plugins you’d recommend?
Even custom PHP/JS setups are welcome — just need something fast and simple.
PHP DOMDocument/XPath not extracting movie data from Paytm Movies page
I’m trying to scrape movie details (name, genre, etc.) from Paytm Movies Coimbatore using PHP’s DOMDocument and XPath. While my code fetches the HTML successfully, it fails to extract text content from movie cards.
{"@context":"http://schema.org","@type":"Movie","name":"Good Bad Ugly","url":"https://paytm.com/movies","genre":"action","image":"https://assetscdn1.paytm.com/images/cinema/Goof-e0906bf0-115c-11f0-ac8c-93d19273dc5b.jpg","inLanguage":"Tamil","duration":"PT140M","datePublished":"2025-04-10","releasedEvent":{"@context":"http://schema.org","@type":"PublicationEvent","startDate":"2025-04-10","location":{"@type":"Country","name":"IN"}},"aggregateRating":{"@context":"http://schema.org","@type":"AggregateRating","ratingValue":9.3,"bestRating":10,"ratingCount":2031}}93%Good Bad UglyUA16+TamilBook Ticket
<?php
header('Content-Type: text/html; charset=utf-8');
$url = "https://paytm.com/movies/coimbatore";
// Initialize cURL with headers
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Language: en-US,en;q=0.5',
]
]);
$html = curl_exec($ch);
if (curl_errno($ch)) {
die('cURL error: ' . curl_error($ch));
}
curl_close($ch);
$dom = new DOMDocument();
libxml_use_internal_errors(true);
$dom->loadHTML('<?xml encoding="UTF-8">' . $html);
libxml_clear_errors();
$xpath = new DOMXPath($dom);
$movies = [];
// Updated selectors based on current Paytm structure
$movieCards = $xpath->query("//div[contains(@class, 'movie-card') or contains(@class, 'movie')]");
foreach ($movieCards as $card) {
// Check if the card is valid
echo '<pre>'; print_r($card->textContent); echo '</pre>';
}
?>
output data like
Array (
[0] => [
'title' => 'Kill bill',
'genre' => 'Action',
'url' => '/movies/kill bill'
]
)
Slack files.completeUploadExternal sometimes fails with internal_error:put, internal_error:resp, or CloudFront 504 – what could cause this?
Slack has deprecated the files.upload API, so I’m migrating to the recommended flow using files.getUploadURLExternal → direct file upload → files.completeUploadExternal
Most of the time this flow works, but intermittently it fails with the following errors:
• “error”: “internal_error:put”
• “error”: “internal_error:resp”
• HTTP 504 Gateway Timeout from CloudFront during the direct file upload step.
I can’t yet determine what triggers the failures — file size seems small (~30KB), and the behavior is inconsistent.
Here’s a simplified version of my PHP (Symfony) flow:
-
Get Upload URL
$getUrlResponse = $this->slackApi->request('POST', 'https://slack.com/api/files.getUploadURLExternal', [ 'body' => [ 'filename' => 'Purchase Order 204.pdf', 'length' => 31112, ], ]); -
Upload the file:
$uploadResponse = $this->slackApi->request('POST', $getUrlResponse->getUploadUrl(), [
'body' => $parameters->getFile(), // Raw binary stream
]);
if ($uploadResponse->getStatusCode() !== 200) {
throw new LogicException($uploadResponse->getContent(false));
}
- Complete the upload:
$this->slackApi->request('POST', 'https://slack.com/api/files.completeUploadExternal', [
'json' => [
'files' => [[
'id' => $getUrlResponse->getFileId(),
'title' => $parameters->getFilename(),
]],
'channel_id' => $parameters->getChannelId(),
'thread_ts' => $parameters->getThreadTs(),
],
]);
```
Are there known reasons behind internal_error:put or CloudFront 504 in this flow, and how can they be mitigated?
Why in element-plus date-picker component on save lose 1 day?
In Laravel 12 / vuejs 33.5.13 / element-plus 2.9.5 app I use date-picker component
<el-dialog v-model="dialogVisible" title="Select Day">
<el-form :model="form" :rules="rules" ref="formRef">
<el-form-item label="Day" prop="day">
<el-date-picker
v-model="form.day"
type="date"
placeholder="Select Day"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">Cancel</el-button>
<el-button type="primary" @click="saveElection">Save</el-button>
</span>
</el-dialog>
methods: {
addItem() {
this.form = {id: null, type: '', day: new Date()};
...
},
But when I select I see that saved data is minus 1 day. Say, I if I selected 2025-04-29, value 2025-04-28T21:00:00.000Z is requested to database and in db table I see 2025-04-28
config/app.php I have :
'timezone' => 'Europe/Kyiv',
I read docs at https://element-plus.org/en-US/component/date-picker.html#enter-date, but did not find if timezone can be set for el-date-picker component or for
element-plus library. How can I fix it ?
ugcPosts returns empty elements array despite total count > 0 [closed]
I’m trying to fetch company posts from LinkedIn using the ugcPosts API. The response shows total: 449, but elements is an empty array.
- Access Token Retrieved Successfully
I’m able to authenticate and get an access token. Example token (truncated for security):
AQVDf5VKdYJGIBL9... (token works for other endpoints too)
- API Endpoint Called
$accessToken = '...'; // valid token
$organizationId = 'urn:li:organization:organizationid';
$encodedOrgId = urlencode($organizationId);
$url = "https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List($encodedOrgId)";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer $accessToken",
"X-Restli-Protocol-Version: 2.0.0"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
Issues:
-
API shows
total: 449posts. -
But
elementsarray is always empty. -
Tried pagination, still empty.
Token has the scopes:
-
r_organization_social -
rw_organization_admin
Things I’ve Checked:
-
Access token is valid.
-
Organization URN is correct.
-
User is a Super Admin of the organization.
-
Token has proper scopes.
-
Other API calls like
/v2/organizations/{id}work fine. -
Using latest
X-Restli-Protocol-Version: 2.0.0.
-
Why does
ugcPostsshow a total count but no elements? -
Is there any additional permission needed?
-
Is this behavior expected for posts created by other admins or scheduling tools?
-
How can I debug or verify ownership of the posts?
SiteGround Cron Job Not Executing Scheduled Script – How to Debug?
I’m trying to run a cron job on my SiteGround-hosted website, but it doesn’t seem to be executing as expected.
Here are the details:
What I’m trying to do:
I want to run a PHP scheduler command :
/usr/local/bin/php /home/customer/www/dhnahda.egfm.ae/public_html/dubai_health_token_system/artisan schedule:run > /dev/null 2>&1
- Every 30 minutes
- Tried both standard and custom intervals
What I’ve tried:
- Checked that the script runs fine via browser.
- Checked file permissions (it’s executable by the web server).
- Added logging to the script, but nothing is being logged.
- Tried absolute path and relative path.
- Added
#!/usr/bin/phpat the top of the script – still no luck. - No emails or error output from cron.
How can I debug this issue? Is there a way to see cron job logs on SiteGround, or is there something wrong with my cron setup?
Please help me urgently…..
Still got DEPRECATED messages in the dev log file
- Prestashop 8.2
- PHP 8.3
In my defines.inc.php I have:
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false);
/* Compatibility warning */
if (!defined('_PS_DISPLAY_COMPATIBILITY_WARNING_')) {
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false);
}
if (_PS_MODE_DEV_ === true) {
$errorReportingLevel = E_ALL | E_STRICT;
// if (_PS_DISPLAY_COMPATIBILITY_WARNING_ === false) {
$errorReportingLevel = $errorReportingLevel & ~E_DEPRECATED & ~E_USER_DEPRECATED;
// }
@ini_set('display_errors', 'on');
@error_reporting($errorReportingLevel);
define('_PS_DEBUG_SQL_', true);
@error_reporting(E_ERROR | E_WARNING | E_PARSE);
} else {
@ini_set('display_errors', 'off');
define('_PS_DEBUG_SQL_', false);
}
But I still get a lot of deprecated messages in the var/logs dev file
Then the __contruct method of my module I added:
error_log('[NICO] error_reporting = ' . error_reporting());
Then in my apache log I got:
[NICO] error_reporting = -1,
Which means the error_reporting is not defined in defines.inc.php.
Any idea?
It is a fresh install of PHP, without any module, except the one I try to develop.
PHP: Call to undefined function broken in php 8.2 [duplicate]
I have a php script which takes in a photo and positions it accordingly in my web page.
I’ve been using it for years now with php 7.4 but when my ISP upgraded php to 8.2, it broke.
The web page that accesses it (simplified) looks like this:
<html>
<head>
<title>PHP Test</title>
<?
require ("photos_placement_simple.inc");
?>
</head>
<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
?>
<?php echo '<p>Hello World</p>';
$result1 = getimagesize("../VCSC_articles/images-articles/1957-Airbox-Corvette-970679_a" . "_s.jpg");
echo"$result1 is $result1[1]<br />n";
echo"$result2 is $result1[2]<br />n";
echo"$result3 is $result1[3]<br />n";
?>
<?php
one_photo ('1957-Airbox-Corvette-970679_a', '1957 Airbox Corvette Sold at Mecum Auctions');
?>
</body>
</html>
The php script that is accessed (photos_placement_simple.inc) is (again simplified):
<?php
function one_photo($photo1, $photo1_title) {
// Lets determine the height and width of the graphic
$result1 = getimagesize("../VCSC_articles/images-articles/$photo1" . "_s.jpg");
$left = (390 - ($result1[0] / 2)) + 10;
$height = $result1[1] + 10;
echo "<div style="height:"."$height"."px;">n";
echo "<span style="position:absolute; left:" . $left . "px;">n";
echo "<a href="../../VCSC_articles/images-articles/$photo1.jpg" rel="lytebox" ";
if (isset($photo1_title)){echo "title="$photo1_title">";}
echo "<img src="../../VCSC_articles/images-articles/"."$photo1"."_s.jpg" alt="$photo1_title" width="$result1[0]" height="$result1[1]" border="0"></a>n";
echo "</span>n";
echo "</div>nn";
}
?>
The fatal error occurs at the one_photo (‘1957-Airbox-Corvette-970679_a’, ‘1957 Airbox Corvette Sold at Mecum Auctions’); line. The error is “Uncaught Error: Call to undefined function one_photo()” so I guess my question is: How do I define the one_photo() function?
I have the ability to rollback to php 7.4 via .htaccess so it all works for my users. Still I want to be able to use the latest php version. The site is hardcoded via BBEdit, not WordPress, etc.
Comments, suggestions and solutions are appreciated.
~paul
PHP $_SERVER[‘DOCUMENT_ROOT’] removed a slash
I read other posts about $_SERVER[‘DOCUMENT_ROOT’] (like this) but what happened to me is that all the pages in my website basically lost the slash overnight.
I didn’t change anything neither to the pages nor the config files…
What can I have done wrong to trigger this?
Is there a faster way to solve it than just update every single page?
I use $_SERVER[‘DOCUMENT_ROOT’] . ‘/folder/library.php’ pretty much in every file, so it’s going to take a while (and a lot of pages not working) before to correct them all.
TA
I can’t delete previously selected data in choice.js [closed]
Here I have a problem using choice.js, where the data selected in the first dropdown still appears in other dropdowns. Here I have added a dropdown update function in other functions, the results are still the same. data still appears in all dropdowns even though it has been selected
I use choice.js it is used to be responsive from desktop to mobile. maybe there are options other than choice.js?
function initChoicesOnNewSelect(selectElement) {
if (!$(selectElement).hasClass('choices-initialized')) {
new Choices(selectElement, {
searchEnabled: false,
itemSelectText: '',
});
$(selectElement).addClass('choices-initialized');
}
}
function updateDropdownOptions() {
var selectedValues = [];
// Ambil semua nilai yang sudah dipilih di dropdown
$('.gejala-select').each(function() {
var selectedValue = $(this).val();
if (selectedValue !== "") {
selectedValues.push(selectedValue);
}
});
$('.gejala-select').each(function() {
var currentSelect = $(this);
var currentValue = currentSelect.val();
currentSelect.find('option').each(function() {
var optionValue = $(this).val();
if (optionValue !== "" && selectedValues.includes(optionValue) && optionValue !== currentValue) {
$(this).prop('disabled', true);
} else {
$(this).prop('disabled', false);
}
});
});
$(".gejala-wrapper").each(function(index) {
if (index === 0) {
$(this).find(".btn-hapus-gejala").hide();
} else {
$(this).find(".btn-hapus-gejala").show();
}
});
}
$(document).ready(function() {
$(".btn-tambah-gejala").click(function() {
var newDropdown = `
<div class="form-group gejala-wrapper">
<div class="select-wrapper">
<select name="gejala[]" class="form-control input-lg mt-2 gejala-select">
<option value="">Pilih Gejala</option>
@foreach($gejala_list as $gejala)
<option value="{{ $gejala->kode_gejala }}">{{ $gejala->nama_gejala }}</option>
@endforeach
</select>
</div>
<button type="button" class="btn btn-danger btn-hapus-gejala">Hapus</button>
</div>`;
$("#gejala-container").append(newDropdown);
let newSelect = $("#gejala-container .gejala-select").last()[0];
initChoicesOnNewSelect(newSelect);
updateDropdownOptions();
});
$(document).on("click", ".btn-hapus-gejala", function() {
if ($('.gejala-wrapper').length > 1) {
$(this).closest(".gejala-wrapper").remove();
updateDropdownOptions();
}
});
$(document).on('change', '.gejala-select', function() {
updateDropdownOptions();
});
$(".gejala-select").each(function() {
initChoicesOnNewSelect(this);
});
updateDropdownOptions();
});
WP-Event-Manager Remove restrictions for submitting events
Since WP event manager did an update, it is no longer possible for logged in users with the rol ‘subscriber’ to edit their own published events. How can I commenting this line below so the restriction on event submission for subscribers will be removed?
In function.php is now writing:
// add_action(‘wp_event_manager_event_submit_before’, array($this, ‘wpem_restrict_non_organizer_access_to_dashboard’));
Stripe PHP invoice, how to send specific value
I am trying to send invoices from my web app for school instrumental music lessons. The amount can vary depending on institution rates and grouping.
This is what I have been trying:
function createStripeLessonInvoice($parentName, $email, $childName, $instrument, $grouping, $cost, $lessonCount) {
StripeStripe::setApiKey('sk_test_[MYKEY]');
try {
//Get or create customer
$customer = getOrCreateStripeCustomer($email, $parentName, null, $childName);
error_log("COST IS $cost");
error_log("Invoice creation with cost: " . ($cost * 100)); // Check the amount in pence
// Create the invoice
$invoiceItem = StripeInvoiceItem::create([
'customer' => $customer->id,
'amount' => $cost * 100, // amount in pence
'currency' => 'gbp',
'description' => 'Lesson Fee',
'metadata' => [
'student_name' => $childName,
'instrument' => $instrument,
'grouping' => $grouping,
'lesson_count' => $lessonCount,
'total' => $cost,
],
]);
$invoice = StripeInvoice::create([
'customer' => $customer->id,
'collection_method' => 'send_invoice',
'days_until_due' => 7,
]);
//Finalize the invoice
$finalized = $invoice->finalizeInvoice();
//Return the invoice URL or log
return $finalized->hosted_invoice_url;
error_log("Invoice item created: " . print_r($invoiceItem, true)); // Log the invoice item creation
//Finalize the invoice
$invoice->finalizeInvoice();
error_log("Invoice finalized: " . print_r($invoice, true));
// Return the hosted invoice URL
return $invoice->hosted_invoice_url;
} catch (StripeExceptionApiErrorException $e) {
// Handle Stripe API errors
error_log('Stripe error: ' . $e->getMessage());
return null; // or handle this error more gracefully
}
}
Logging shows that the cost is £90, but I get a £0 invoice to the correct customer each time (which obviously doesn’t send).
Is what I am trying to do not possible with Stripe, or have I missed something?
Thanks,
Chris
Deploying Vue with Hostinger [closed]
I’m using a PhpStorm for developing my Vue app with pure PHP to connect the MySQL database, now I want to deploy it using Hostinger with shared hosting how do I do that?