Questions tagged [php-7]

PHP 7 is the successor to PHP 5.6, it was released on December 3, 2015. Use this tag for issues relating to development using PHP 7

php-7
Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

Debian 10 - Remove 2 different versions of PHP

I have a really screwed up Debian 10 system. It has about 20 years worth of customer records I have been tasked with recovering. I'm pretty sure the problem started, when someone upgraded it from ...
billbrach's user avatar
1 vote
0 answers
35 views

Can I persist a flag across all sessions?

I have an expensive operation that runs in my PHP application when the /api/replicate endpoint is requested. The operation takes roughly 30 seconds, so I want to prevent this endpoint from being ...
Cardinal System's user avatar
0 votes
0 answers
23 views

Apache or PHP issue is downloading ONLY Some Pages such as index.php and some rewrite pages. Other pages work fine [duplicate]

I use VirtualMin/Webmin (https://www.virtualmin.com/) for my hosting server. There must have been an update, but I am honestly still not sure what exactly happened, but since last few days all of a ...
microtekblue's user avatar
0 votes
1 answer
50 views

overwriting basic count function in laravel globally

We are upgrading our laravel project, and it includes a language upgrade from php7 to php8. Consider this code: $a = new stdClass() count($a) Will result in: // php7 ==> 1 // php8 ==> ...
yuvi's user avatar
  • 18.3k
0 votes
1 answer
53 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 ...
smallbee's user avatar
  • 351
0 votes
1 answer
174 views

Drupal 7 modules appear to be php8 compatible but crashes when server changes from php7.3 to php8.1

Somewhere it said that Drupal 7.8 updated core and modules are php compatible with php8.1. However, when I change the cpanel multiphpmanager for the Drupal 7 domain to php8.1, the site crashes. The ...
Mike Burman's user avatar
-1 votes
2 answers
57 views

$_GET not display character like & [duplicate]

i tried to create a script to redirect link of amazon, but when pass the link in a get variable url not return Url after the character &, i tried to echo the variable $_GET['tolink'] but display a ...
gassiopea's user avatar
2 votes
1 answer
758 views

Why i get alert : "This page has expired" in laravel livewire upon logging back in in?

I created a step-by-step form using Laravel Livewire, following this tutorial: here. However, I'm experiencing some issues when logging in after logging out, when I submit the form I get a alert: &...
BAKKALIAYOUB's user avatar
0 votes
0 answers
98 views

Encryption/Decryption with Sodium extension with php 5.6 not working

My Old project is on 5.6 so Sodium extension for Encryption/Decryption is not working so my system engineer set some setting that if I run file with .php7 extension it run on php 7 and normal .php ...
New Laravel Bugs's user avatar
0 votes
0 answers
362 views

firebase/php-jwt throws Signature verification failed error on every scenario in PHP 7.4

I've installed firebase/php-jwt as described in the repo. In composer file. "firebase/php-jwt": "~5.5.1", "paragonie/sodium_compat" : "~1.19.0", In my PHP file ...
Ariful Haque's user avatar
  • 3,682
0 votes
1 answer
32 views

Under the Laravel 7 (php7) system, if I query any id of my table, there is no result

Under the Laravel 7 (php7) system, if I query any id of my table, there is no result, but if I enter the id value as a string, then there is a result. In the table, the id column type is int(11). ...
Prograptor's user avatar
1 vote
1 answer
58 views

Cannot access the properties inside the Closure object in php 7

I have this in my unit test code: $data = $this->_createSfApiFindMock($cisDataCount); var_dump($data()); die(); output: class Closure#731 (3) { public $static => array(4) { '...
whitesiroi's user avatar
  • 2,795
0 votes
2 answers
327 views

Prestashop 1.7: Use statement not working in module main php file

I would like to edit the kpi section on the admin orders page,in Prestashop 1.7, so i created a module, i tried to use a custom module class, in the module's main php file, but i got error so I ...
tarek fellah's user avatar
-1 votes
2 answers
280 views

Laravel ErrorException Undefined variable in my public function

I ran into the error: ErrorException Undefined variable: pesan I have gone through similar problems solved here but none of the solutions have worked for me. The error is thrown from my ...
Farid Naufal's user avatar
2 votes
0 answers
304 views

Errors in PHP 7 - why set_error_handler() can't catch this type of error?

Fatal error: Uncaught TypeError... Why is this an exception according to PHP if TypeError inherits from Error? Why can't set_error_handler() catch this type of error? https://www.php.net/manual/en/...
user avatar
0 votes
1 answer
395 views

ubuntu 18.4: how to get php 7.2 to work with apache 2?

I purchased a virtual server from vpscity, and chose the Ubuntu 18.4 64bit image. it came with apache 2 installed. i am trying to get webpagetest server installed using these instructions: https://...
John Little's user avatar
  • 11.4k
0 votes
0 answers
140 views

Call one controller function from another using Curl PHP in CodeIgniter 3

Hi I am using Curl PHP to callone controller from Another but even after passing CSRF it is giving me 403 error MAIN controller file ` <?php defined('BASEPATH') or exit('No direct script access ...
Addy_dev's user avatar
1 vote
5 answers
305 views

How do I print an array value as a template tag as blank in shorthand, even if it's null?

If I have this in my main php file (eg. my controller) $debate['title'] = NULL; And this in my template file (eg. my views file), where I can include PHP with my HTML. Imagine that I'm using a ...
desbest's user avatar
  • 4,814
0 votes
1 answer
311 views

phpinfo() changes the status code of nginx response in a weird way

I have a php code that should always end up being "http 500 code" as I have a call to undefined func status_code("OK"); code: <? # phpinfo(); echo 'error_log = ' . ini_get('...
DmitrySemenov's user avatar
0 votes
1 answer
360 views

digital signature in pkcs7 format with base64 encoding PHP

Is any pre-define function in PHP for making signature in pkcs7 format? I have .pfx certificate with me
Sameer's user avatar
  • 1
0 votes
0 answers
63 views

Bypass auto wiring using services.yml symfony

I have a quick question regarding auto wiring on symfony. I am currently migrating my symfony 2.8 app to symfony 5.4. I have my BaseManager class which is used by several manager of my application. ...
oracle972's user avatar
0 votes
0 answers
23 views

How to conditinally create a field in an array during initialization?

Consider this code: $foo = [ 'x' => 'asdf', 'y' => $bar, ]; What I want is that if $bar is null, then the field 'y' should not even be created. I know that I can create $foo first and ...
klutt's user avatar
  • 30.8k
0 votes
1 answer
423 views

How to properly flush buffer without error suppression

I found this snippet many years ago, it's always done me well but I found out recently that error_get_last() and any custom error handlers will ignore the @ and still trigger. The recommended approach ...
ParoX's user avatar
  • 5,803
0 votes
1 answer
307 views

Apache2 2.4 not executing PHP 7.4 code, module not showing up

I have Apache2 running on a Debian 11 box (x64). It was installed with an Openmediavault ISO, with nginx and PHP 7.4 installed already (for the web UI) I try to install the PHP connector for apache2 (...
EnderSlayer7692's user avatar
0 votes
1 answer
128 views

Update key value in array of objects php

I have an array of objects where the reference is not the same as the code_cip. Array ( [9921279] => lignecatalogue Object ( [id] => 3013181 [reference] => 9921279 [commentaire] => [...
Rohan's user avatar
  • 3
0 votes
1 answer
42 views

Convert many:many response into single objects

I have defined a users table, a roles table and a user_role pivot in my database. The model for the user is as follows: <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class ...
cross19xx's user avatar
  • 3,400
-1 votes
1 answer
98 views

PHP exec shell script return status 2

I want to execute shell script from my php application deployed on Red Hat linux server, I added this line to my application exec("/app/sh/script.sh user server.info.com cmd.com 0 1 1" , ...
nechmi bader's user avatar
1 vote
2 answers
35 views

Line up two tables

I have two following arrays: $array1 = [ ['date' => '2021', 'income' => 123], ['date' => '2022', 'income' => 123], ['date' => '2023', 'income' ...
proggaf's user avatar
  • 29
1 vote
1 answer
393 views

Composer issues when running mPDF in PHP 7.4

I get the following error when running mPDF in my browser. I have just installed the latest version of mPDF on my cloud server running PHP 7.4. The requirements page for mPDF say I should be able to ...
Mike Barbaro's user avatar
0 votes
1 answer
21 views

How to use an anonomyous function directly to assign a value? [duplicate]

I know I can do this: $myFunc = function () { return 42; }; $val = $myFunc(); But I want to skip $myFunc and do something like this: $val = () { return 42; }; Is this possible? Of course, my real ...
klutt's user avatar
  • 30.8k
-1 votes
1 answer
109 views

how to properly load libraries in php? [duplicate]

I'm working with two libraries: phpdotenv spatie/async This is what I'm executing: <?php require_once "/var/local/entrop/vendor/autoload.php"; include_once '/var/local/entrop/inc/...
Dexter Naru's user avatar
1 vote
1 answer
56 views

How to do covert to this code block to php v7.4 or fix the syntax error

Currently I'm working with a laravel base ecommerce project and I got a domain mapping plugin which they provide. But the problem is it's only working on php8 or 8+, but my application runs on php v7....
kanchana godapopla's user avatar
1 vote
1 answer
35 views

I have implemented function without using function key but not able to print the result

I have written one function, without using function keyword. if age is above 15 take the value and push into one array. I have done that but i am not able print the result.Kindly any one help on this. ...
RAJA's user avatar
  • 61
2 votes
0 answers
83 views

PHP 7. I'm not able to display or log errors below. Is this possible? [duplicate]

Example 1 <?php ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); error_reporting(E_ALL); // I guess I miss a semicolon a() b() Example 2 <?php ini_set('display_errors', '...
Hebe's user avatar
  • 741
0 votes
0 answers
52 views

php7 compatibility: Uncaught Exception: Error

can you help me update this script for compatibility with php7? I get error: Uncaught Exception: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ...
k4mk4m's user avatar
  • 1
0 votes
0 answers
16 views

database connection error message not woking [duplicate]

Please, can I know what's wrong with this function. I want if the connection to database is not established to display a custom error message instead of the default exeption. <?php $host = &...
El Mounchit Ayoub's user avatar
1 vote
0 answers
120 views

PHP, Docker, Apache & EC2 - intermittent POST request failures

I'm getting some very odd behaviour with my app on AWS EC2. Every now and again, when a form is submitted via POST, it'll bomb out straight away displaying the submitted form data. There are no logs ...
Rob H's user avatar
  • 46
0 votes
1 answer
292 views

Sessions not working on CDN but works on localhost

Code works well on localhost, but when i deployed it on hosting that is using CDN, the PHP session is not working. On page1, I have form that is using token <form method='post' action='page2'> ...
Sam San's user avatar
  • 6,751
0 votes
1 answer
2k views

Run jobs one after another in Laravel 8

I'm trying to automate a process composed from multiple jobs. Every job had a goal, so I'm running a global job who is responsible for creating child jobs. - Job-1 Global Job -> - ...
KubiRoazhon's user avatar
  • 1,789
-2 votes
1 answer
122 views

Htmlspecialchars return a mistake value

I'm using PHP 7.4, when I run echo htmlspecialchars("Jours Fériés", ENT_QUOTES); I get an empty string. when I run echo htmlspecialchars("Jours", ENT_QUOTES); I get "Jours&...
mourad semi's user avatar
0 votes
1 answer
683 views

Laravel - Passing data from multiple methods from the same controller to a partial view

I have a simple phone book application with a main view, index.blade.php that includes a partial view, contact_list.blade.php. I only have a single route that refers to my controller, ...
Laila Campos's user avatar
0 votes
1 answer
1k views

Laravel 8 - htmlspecialchars() expects parameter 1 to be string, object given

I'm trying to access a Controller method from inside my view, but I'm getting this error: htmlspecialchars() expects parameter 1 to be string, object given (View: D:\Programming\Php\Laravel\Laravel-...
Laila Campos's user avatar
0 votes
2 answers
2k views

Laravel - PDOException::("SQLSTATE[42S02]: Base table or view not found: 1146 Table 'vestibulare.app\models\telefone' doesn't exist

I'm new to Laravel. I'm trying to access some data from within a partial view. I tried to put my query inside the boot method of AppServiceProvider, but Im getting this error: PDOException::("...
Laila Campos's user avatar
0 votes
1 answer
78 views

Run phpunit with custom php path

I'm working on Redhat server, I'm going to add unit test (PHPUnit) to an existing application, PHP is installed on custom path /logi/php7211 (I shouldn't change any configuration), when I run the ...
mourad semi's user avatar
1 vote
1 answer
130 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"; . . ...
mourad semi's user avatar
1 vote
1 answer
209 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 ...
mourad semi's user avatar
-2 votes
1 answer
134 views

FInd Missing number and MIN and MAX Value and find Dublicate values count WITHOUT using PHP inbuild functions.Checked many but no suitable for me [closed]

I am having below array $inputArray = array(1, 2, 5, 7,2); Now i want to find MIN and MAX Values. Second Thing find missing values in this array Third dublicate number count, How can i acheive ...
RAJA's user avatar
  • 61
0 votes
0 answers
1k views

Installing PHP 7.4 manually (offline) on Linux Red Hat server

I have upgraded from PHP 5.3 to PHP 7.2 and the application is working. now I want to upgrade to PHP7.4, when I run the command './configure' '--prefix=/logi/php746' '--bindir=/logi/php746/bin' '--...
mourad semi's user avatar
0 votes
0 answers
272 views

phpMyAdmin does not respond to clicks

My phpMyAdmin web-interface is loaded properly, login OK, I can see a standard post-login screen with all database names etc., but when I left-click on anything - nothing works. I can't even logout. ...
sda's user avatar
  • 143
0 votes
1 answer
391 views

How to manage includes, require and use in this project

In this PHP project without framework, I have this folder structure: Adapter, Class and Models A php file "index.php" is executed from the root and I have problems handling the model and ...
ilernet2's user avatar
  • 125

1
2 3 4 5
55