All Questions
1,064 questions
0
votes
0
answers
63
views
Apache2 failing when enabling php mod (Ubuntu 20.4)
I've install php5.3 (from ppa:sergey-dryabzhinsky/php53), but when installing apache2 and then enabling it through sudo a2enmod php53 the output says to run sudo systemctl restart apache2, however ...
0
votes
1
answer
73
views
Errors PHP Notice: Undefined offset:, Trying to access array offset on value of type null
I get multiples php errors in server log , the error show on 2 lines of my php code, However php script is working but it show these errors in server log.
PHP Notice: Trying to access array offset on ...
0
votes
0
answers
27
views
share a property in different functions within a same class in php wordpress
I have this code example, where I am not receiving the value of $something in the passData() function, since null comes, what is happening, this is code example:
class ClassName extend X {
...
1
vote
1
answer
177
views
Upgrading from PHP 5 to PHP 7.4
I'm upgrading an exsiting application from PHP 5.3 to PHP 7.4
class Cl_Detail_Familles_Produit extends Cl_Form
{
public $ref_annuler = "../coh/list_produit.inc";
.
.
...
1
vote
1
answer
274
views
PHP string without quotes
I'm upgrading an exsiting application from php 5.3 to php 7.
I found this code in the application $this->upload_err = ERR_CORRUPTION;
I didn't found any const whith the name ERR_CORRUPTION
can we ...
1
vote
2
answers
916
views
PHP Imagick breaks SVG on conversion to PNG
I'm updating a super legacy app and I'm trying to move from PHP 5.3 to PHP 5.6. Everything is going smoothly except for Imagick.
On old server we were using Imagick 3.0.0 and now on newer server with ...
1
vote
1
answer
385
views
Migration to PHP8
I have code from old PHP.
But when I tried to execute it by PHP 8.
The first code was:
PasteBin
I had error:
Fatal error: Array and string offset access syntax with curly braces
is no longer ...
1
vote
0
answers
576
views
PDF is printed in text to browser instead of downloaded
I'm working on a legacy app running php 5.3 and for some reason on production server PDF files are printed in gibberish straight to the browser instead of being downloaded.
Nothing was changed and in ...
0
votes
2
answers
61
views
How to create recursive array from the loop PHP? [closed]
I have an array like below and its dynamic array.
$array = [10,20,30,40,50];
I want to create an another array recursively using the above array values. Looks like below
Array
(
[10] => ...
3
votes
0
answers
979
views
Laravel multiple morph relation in one table
i have problem in laravel. i have created multiple morph in one table.
table structure
table_name : morphicable
id:
model_id: eg: '1'
model_type: eg 'model/comment'
model_one_id: eg: '1'...
-2
votes
1
answer
1k
views
Stripe Checkout PHP Causes mysterious 404 Error OnLoad
I'm having a hard time testing the Stripe Checkout from single-checkout-subscription on my local xampp server. So far, I have a Stripe account, created my test keys, product and prices, installed ...
1
vote
0
answers
386
views
set_charset utf8mb4 not working in php 5.3
For some reason i can't change the charset of the mysqli connection to utf8mb4 on PHP 5.3.0, 5.3.1, 5.3.2, etc... up to PHP 5.4.0.
I have a class which extends mysqli and in the constructor after i ...
-1
votes
1
answer
157
views
Downgrade to PHP 5.3
I've got a line of code that I need to get working in PHP 5.3.3.
I cannot upgrade the PHP version.
The error is in the last line below with the ::class property
(unexpected T_CLASS, expecting ...
4
votes
1
answer
4k
views
How to Post on Linkedin Company page via Linkedin API v2 in PHP
I created a personal account on LinkedIn and later i created a company page with the same personal ID. What i am trying to achieve is. I want to create auto scheduler in php so that i can post some ...
-1
votes
1
answer
358
views
How to use call_user_func in PHP
Hi call_user_func is used in my existing code but it is throwing an INTERNAL SERVER ERROR
$out=call_user_func($func);
$func variable has an array like this.
Array
(
[0] => MetricName ...
0
votes
1
answer
320
views
display the array which meets only this condition in php
i have a multidimensional array, and iam looping inside to get the sub-arrays:
so i have a sub-array lie this:
array (
0 =>
array (
'norm_value' => 2.5,
),
1 =>
array (
'...
1
vote
0
answers
926
views
Configure, build and install PHP 5.3.13 on Centos 7.2
I am trying to install PHP 5.3.13 on Centos 7.2. Finally got ./configure to work after installing a few devel-dependencies. But when running make I get the following error:
/usr/src/php-5.3.13/ext/...
0
votes
0
answers
762
views
Dockerfile Fix For Hosting PHP 5.3 Application on IIS
Trying to setup a container to run a PHP application version 5.3. The required webserver is IIS and when I run the following container interactively I receive the following lines of errors:
Service '...
-1
votes
1
answer
40
views
i want to add values of a column of tables from 1st day of the selected month till the selected date.OR simply i can say i want to calculate MTD?
i have no idea about the code...
database is something like this..
id mgeneration igeneration date
1 548711 541 2019-05-01
2 54879 522 2019-05-04
3 ...
2
votes
0
answers
100
views
Is there a way to search for ArgumentCountError in PHP?
Is there a way to search for ArgumentCountErrors (to few arguments passed into a function from a function call) in a project?
I had no luck with PhpStorm, it only displays an error if there are too ...
-1
votes
1
answer
88
views
How to use different file name for same file while using file_get_contents?
I can use
file_get_contents("https://example.com/file.txt?some");
And I want to know if there's similar way to do it with local server files. Like
file_get_contents("./file.txt");
Please let me know ...
3
votes
3
answers
7k
views
Trying to install the GMP extension on Docker / php:5.3
I'm trying to test some PHP code on PHP 5.3 with the GMP extension installed. Here's my Dockerfile:
FROM php:5.3
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 ...
1
vote
0
answers
64
views
How to use implode() in sql operator? [duplicate]
My problem is that i stock a variable (id_chambre) as an array in my database and i want to use it in SQL but it's not working :
$sql = "SELECT c.*
FROM chambre AS c
LEFT JOIN reservation_client AS ...
0
votes
3
answers
6k
views
how to get shopee api Authorization use php5.3
i want to get shopee authorization using the source code.
The language I use is php.5.3.2.
No matter how many times I search, I only have a demo about the higher version, so I can't find the answer I ...
1
vote
1
answer
293
views
Strange Results for String comparison in PHP
We ran into an issue today that I am surprised I had not encountered before. It was related to string comparison:
echo ("9400110897799014514025" == "9400110897799014514018" ? "match" : "not");
echo (...
1
vote
3
answers
4k
views
Proper steps to migrate PHP 5.6 code into PHP 7.3 [closed]
we have developed previously in house system based on PHP 5.6 now we want to upgrade same code into PHP 7.3, we have not used any PHP framework we are using core way to write code means we are not ...
0
votes
1
answer
3k
views
How to fix fatal error when running PHP 7.1 break not in loop
Excel files can be downloaded and edited when server using PHP 5 but it's error in PHP 7. It shows fatal error break not in the loop
I already try to remove break in the loop but it doesn't work.
...
0
votes
1
answer
447
views
C# DateTime.MinValue Field In PHP
In c# i can get the min value of the DateTime like this DateTime.MinValue
DateTime.MinValue
What i'm trying to do is the same but in PHP
Is there a way in php to get the min value of the
DateTime ...
0
votes
1
answer
198
views
paypal payment url not working usin php 5.3
I have problem with paypal payments.
All codes is working well but when the page go to payment link/url it will be convert to paypal account homepage.
I am using this:
if (!isset($_POST["txn_id"]) &...
1
vote
1
answer
688
views
Strange attack script inserted in WordPress code
A WordPress website couldn't be accesed from yesterday and only showed a message started with this
Bootstrap file for setting the ABSPATH constant and loading the wp-config.php file. The wp-config....
-1
votes
1
answer
321
views
Divide values from 2 arrays
I have this array
$a = [
0 => [
'period' => '2017/2018',
'product' => 'AM',
'quantity_1' => 20,
'quantity' => 25,
],
1 => ...
0
votes
1
answer
694
views
Generate .xlsx file using fromArray for a big amount of data
I need to write in a .xlsx file about 111.100 rows, using fromArray() but I have a strange error
I use phpspreadsheet library
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet-&...
0
votes
0
answers
495
views
Can't get Code Igniter to connect to local SQL Server Express instance
I have been struggling for the last three hours with the following issue and so far I can't get this to work properly.
I have an SQL Express instance running in my PC, I have checked already the port ...
1
vote
1
answer
920
views
How to install php musesum version with apache and mysql
I'm having trouble with installing old php 5.3.29 on ubuntu 16.04
Recently I found this useful source on how to install old unsupported php versions which are available only in php museum
sudo apt-...
0
votes
2
answers
57
views
add new items from the array to the combined array by matching key
I want to combine 2 array by matching the key, I have tried in here https://3v4l.org/Jp9Jf I have successfully combined the two arrays, but I want to add the items obtained from $string2 to array ...
0
votes
2
answers
161
views
PHP Slug Generation Function Giving Improper Output
I am using below code to get a proper slug that I am sending from an ajax call.
$slug = strtolower(trim(preg_replace('/[^A-Za-z]+/', '-', $_POST['slug'])));
But, what's happening is. If from an ajax ...
0
votes
1
answer
109
views
Get columns if no data in query
I want to get the columns selected in query if no data are returned
$sql = $this->em->getConnection()->prepare('
SELECT
DATE_FORMAT(cus.period, "%Y") as ...
0
votes
0
answers
1k
views
The connection was reset (PhpStorm and Docker) Mac
I'm having a issue where I cannot access the Docker container on localhost, I get the message below:
The connection was reset
The connection to the server was reset while the page was ...
0
votes
1
answer
368
views
Short open tags in PHP are being changed into html comment tag
I have a legacy PHP application that was built on codeigniter and still runs PHP5.3 on a server managed using PLESK. It was recently migrated to another server with the same environment.
However, in ...
-1
votes
2
answers
399
views
How To store a data in variable in a class function and then access it outside
I am trying to create a page where it will load values from the database and display it. However, I have used classes instead of normal functions.
Following is the middle code I am executing
if($...
1
vote
1
answer
52
views
Sum elements from multimendion array by key
I want to sum all elements from my array based on column
I try to make this sum but not expected results.
My array :
Array
(
[0] => Array
(
[Periode] => 2008/2009
[...
0
votes
1
answer
86
views
How to call function in recursive manner in PHP
I am trying to create a Dynamic header for which i am using recursive logic inside a class function.
I'm using this on the view side.
<nav class="primary-menu uppercase">
<ul ...
-1
votes
1
answer
152
views
Upload csv is not uploaded to the server after generate
I have this code :
$file = fopen('demosaved.csv', 'w+');
fputcsv($file, array('Column 1', 'Column 2', 'Column 3', 'Column 4', 'Column 5'));
$data = array(
array('Data 11', 'Data 12', 'Data 13', '...
-3
votes
1
answer
54
views
Anonymous function in array_walk is throwing error on PHP 5.2
Below is array_walk function which is throwing error on php 5.2.
I have 5.2 version on stage and 5.3 on local and dev. Code works fine on local and dev php version.
foreach($favTracks as $track_id) {
...
0
votes
2
answers
1k
views
How to read file .csv per batch
I have a question so my .csv
"product";"date";"q"
"8";"1995-05-01";"4"
"8";"1995-05-01";"2"
"8";"2001-05-01";"13"
"8";"2001-05-01";"3"
"9";"1995-05-01";"1"
I have about 1 milion rows.
I'm doing ...
0
votes
1
answer
1k
views
How to properly set a Cookie/Header for a SOAP client in PHP?
I am trying to enable xDebug support for a SOAP call following several topics I have found out there (see list at the end of this post) and this is what I have done so far:
$this->_client_soap = ...
1
vote
2
answers
118
views
Replace data dynamically from array in eval()?
I'm trying to replace the value from array.
$row= array("id"=>"35", "name"=>"test","first_name"=>"noor","last_name"=>"fathima");
// Eval Statement -
$row = $row['first_name'].' '.$row['...
-1
votes
2
answers
885
views
PHP 5.3.3 : Download file from server and continue script execution
I'm using this bit of code to download a file (path_facture_name) from the server to the client browser :
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream')...
0
votes
3
answers
694
views
I'm getting undefined index error for multidimensional array in php
I'm new to php so I was trying to code a program which adds two 3x3 matrices. I'm getting undefined symbol error multiple times in php code.
Is there any different way to define multidimensional ...
0
votes
1
answer
139
views
PHP Secure data in the folder above the root folder
Which way is the best to store and address all files which contain security data like sql password and username in the folder above the root folder?
Is there a way to have autoloader.php and a php ...