Questions tagged as ['php']

PHP is a server-side scripting language, used for building browser-based applications. This includes websites as well as programs that don't really need any form of interaction with the user.
Score: 0
Christaiwo avatar
Why MySQLi insert query not working Ubuntu
fr flag

Hi there I'll be glad if anyone has answer to this question, i recently change my pc os to Ubuntu and also download Xampp on it, but the problem now is PHP MYSQLI insert query not working on my pc, all the website i developed before, am unable to register on any of it on my pc localhost,

this site is on running on a lamp server... i initially noticed that there was a problem registering new accou ...

Score: 0
Ramiro Herrera avatar
Can't install php7.4 on WSL Ubuntu
br flag

I'm having trouble installing php7.4 on ubuntu 20 with the following command

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.4

On my ubuntu partition it works just fine, but when trying to install it on WSL and typing php -v I get that the current version is PHP 7.3.32 (cli)

Score: 0
Fardin Kamali avatar
optimize php-fpm and nginx for high traffic on gigantic dedicated server
de flag

I have a dedicated server with gigantic hardware resources as you can see below: HPE ProLiant DL360 G10 2 x Intel Xeon-Gold 5220R 2.7GHz/24 Cores - 48 Threads 256 GB (2933,DDR4) 6 x 480 GB SSD (RAID 10)

This server is dedicated to nginx/php8.0-fpm and redis (for caching)

As we have huge traffic we need to optimize nginx/php-fpm setting but the chanllenging part is to choose right value for php proce ...

Score: 3
Gregor Ostrov avatar
How to install PECL on Ubuntu 21.04 with php8.0
pk flag

i have problems with the usage/installation of the pecl library.

Here is what i did:

echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu hirsute main" >
/etc/apt/sources.list.d/ppa_ondrej_php.list 
apt-get update
apt-get install php8.0-dev
apt-get install php-pear

using pecl gives me this error:

PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported ...

Score: 0
user3409700 avatar
PHP has stopped working on Ubuntu and Apache
us flag

I am running Ubuntu 18.04. I have a LAMP setup. At some point, I realized that my PHP was no longer working. I haven't used it for a while, so unfortunately I can't say when it stopped working. It could well have been when I upgraded to Ubuntu 18.04 from 16.04.

I have scoured the Internet looking for answers to the problem and simply haven't been able to get it working. Here's information about t ...

Score: 0
Finbar avatar
Persistent error with phpmyadmin "Array and string offset access syntax with curly braces is no longer supported"
uy flag

The following error is in my /var/log/apache2/error.log file. I can not access the index.php file or any other phpmyadmin file, in replace of phpmyadmins interface my server returns an http 500 error. All other files work fine, its only phpmyadmin's which has this issue.

Array and string offset access syntax with curly braces is no longer supported in /usr/share/$
$share/phpmyadmin/libraries/Util.php o ...
Score: 0
Brad Thompson avatar
php7.4-fpm active exited
nl flag

This service has been functional but today all the pages do not load and:

Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Apache/2.4.48 (Ubuntu) Server at

There is nothing logged (recently) on php7.4-fpm.log, the service exited and I do not believe this is a normal behaviour, however somebody w ...

Score: 0
Jun Shiozawa avatar
PHP-FPM error log /var/log/fpm-php.www.log Which system user writes the file?
us flag

PHP-FPM error log

/var/log/fpm-php.www.log

Which system user writes the file?

I have file permission

$ sudo chmod 666 /var/log/fpm-php.www.log

The file permissions are set to.

This file permission

$ sudo chmod 604 /var/log/fpm-php.www.log

I would like to change it to

However,

PHP-FPM error log

/var/log/fpm-php.www.log

I don't know which system user wrote the file.

$ sudo chown ?:? /var/log/fpm-php.www. ...

Score: 0
How to change PHP version in Ubuntu 20.04 console?
in flag

How can I change the PHP version used in console on Ubuntu 20.04? I have all versions in the /etc/php folder, but I don't know where the configuration for the command line version is.

Score: 0
Raj  avatar
Unable to create PHP-MySQL connection in Ubuntu 21.10
sa flag

The application was working fine prior to update of 21.10 After going through the details I found there is issue with php-mysql connection in 21.10.

I am using the same code since ubuntu 18.04.

Score: -1
Whether there is any compatibility issue for PHP 5.6 and Apache 2.4.51 on Ubuntu 18.04/20.04?
cn flag

I am replicating an environment. The original environment contains Ubuntu 14.04, PHP 5.6 and Apache 2.4.51

Since 14.04 (and 16.04) is out of life, following are the possible Ubuntu OS that I can use:

  1. 18.04

  2. 20.04

I also know that PHP 7+ is supported on Ubuntu 16.04 onwards.

My question is that - whether there is any compatibility issue for PHP 5.6 and Apache 2.4.51 on each of the above Ubuntu OS ve ...

Score: 0
Php 8.0 won't execute phpmyadmin script, but runs simple phpinfo script perfectly
ch flag

No matter which version of Ubuntu, I never have had a problem installing and running phpmyadmin. Not so under 21.10. I have purged and completely re-installed apache2, mysql, and php8.0, deleting the phpmyadmin database and all related account info. Php executes a simple phpinfo script perfectly, but when I attempt to run phpmyadmin, its script displays but will not execute. I must be missing someth ...

Score: 0
Kabi2321 avatar
shell script cannot run in web php
jp flag

I try to run a shell script in my .php web page. The shell script works fine when i directly run it in terminal. But it gives no response in the web page. I can't even know whether there is an error or not.

Here is the code of my shell script:

#!/bin/bash
cd /home/user/Downloads
chmod a+x 123.AppImage
./123.AppImage freecadcmd "/path/to/my/python/abc.py"

And the python script is about putting some dimens ...

Score: 0
Cekero Lelevo avatar
Installing web apps using LAMPP?
co flag

I have both Google Chrome and Firefox. I need to install this repository: https://github.com/jualahmed/mobilerecharge

On my flavour of Ubuntu. Lubuntu. I have downloaded LAMPP (everything and set it up). I just don't know what now to do?

The command lampp (every type of it won't work). Someone told me just to clone this to some folder, but if it was that easy, I would have done it. Some other guy to ...

Score: 0
Dr Brok avatar
About installing .sh Ubuntu 20.04
br flag

I'm trying to install this file .sh https://github.com/greatfire/website-mirror-by-proxy/tree/master/install I used these command line

chmod +x install.sh
sudo ./install.sh

after that it show me those lines

    Building dependency tree
Reading state information... Done
Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsolete ...
Score: 0
Downgrade php 8.0.10 to 8.0.0
in flag

Im tring to download Yii2 framework. The is error: require php >=5.6.0 <8.0 -> your php version (8.0.10) does not satisfy that requirement. How can i downgrade version of php? Thanks in advance for the answers

Score: 1
Ronny Dsouza avatar
I have so many problems with ubuntu 21.10 impish version? Everytime we update ubuntu our php or apache2 environment get stucked?
jp flag

Recently i Upgraded my ubuntu 21.04 to 21.10. when update get finished i got an notification like you have held broken package to resolve please use partial update. I updated again i got an error or new update like arround 12 mb update. I started upgrading i got this

Package dependencies cannot be resolved

This error could be caused by required additional software packages which are missing or not ...
Score: 0
Dimitar avatar
Using Ubuntu 21.10 and trying to install php-dev, getting libpcre2-dev : Depends: libpcre2-8-0
us flag

can someone help me? I am trying to install php-dev using this command sudo apt install php-dev, but I am getting this error

The following packages have unmet dependencies:  libpcre2-dev : Depends: libpcre2-8-0 (= 10.37-0ubuntu2) but
10.38-2+ubuntu21.04.1+deb.sury.org+1 is to be installed
                Depends: libpcre2-16-0 (= 10.37-0ubuntu2) but 10.38-2+ubuntu21.04.1+deb.sury.org+1 is to be installed
 ...
Score: 2
amitshree avatar
Not able to install php 7.4 on Ubuntu 21.10 impish version
cn flag

My ubuntu version:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.10
Release:    21.10
Codename:   impish

Now, I am trying to add ppa:ondrej/php repository using below commands:

$ sudo apt install software-properties-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
software-properties-common is alread ...
Score: 0
Cannot execute sql queries from my localhost website
gb flag
  1. I installed dual boot on a Win 10 laptop
  2. I migrated a functional mysql database and website to this machine.
  3. Queries on phpMyAdmin work fine
  4. The website works and I get connection with the usual mysqli_connect()
  5. But executing the first query from the website I get

Invalid query: SELECT id, datum, typ, belopp, kommentar FROM budget.utgifter WHERE datum>='2010-10-08' ORDER BY datum DESC

This is exac ...

Score: 1
amit_game avatar
Ubuntu 21.10 : Unable to install php 7.4
in flag

I tried to install php 7.4 on latest version of Ubuntu 21.10 but fail.

$ sudo apt install php7.4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package php7.4
E: Couldn't find any package by glob 'php7.4'

Thanks

Score: 7
mahdiakkk avatar
How to install php7.4, 5.6 ubuntu 21.10
de flag

How to install the old version of PHP. It does not work at the moment repository

sudo add-apt-repository -y ppa:ondrej/php

Then:

The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu impish Release' does not have a Release file.
Score: 0
Installation Ubuntu server on top of an existing one
hk flag

Actually I'm developing a web application using PHP and realtime Chat application and notications using NodeJs.

In a Local network There is an ubuntu server to connect some windows machines to make a Local network and a sharing some files.

There is any possibility to install another server on top of this server and allow connections ONLY and STRCLTY ONLY from the local machines? Those machines chang ...

Score: 0
Tanvir443 avatar
Why can't I change php.ini?
cn flag

I hosted a WordPress website on Ubuntu 20.04 via LAMP. Now when I try to install a theme, "The uploaded file exceeds the upload_max_filesize directive in php.ini." this error occurs. I can't save by changing upload_max_filesize in /etc/php/7.4/cli/php.ini.

As you can see in the image below, it says Read Only next to the name of the php.ini file.

Now how can I edit this file?

Score: 1
Hoops avatar
apache2 failed exit code 18.04 to 20.04 with php8
gb flag

Almost the same exact question as another here, but none of the answers helped me..

I upgraded ubuntu 18.04 to 20.04. Running systemctl restart apache2 gives me,

● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2021-10-07 19:54:59 EDT; 28s ago
       Docs: https://ht ...
Score: 1
Raj basnet avatar
Access logs errors "/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php" when using Nginx without PHP
si flag

I'm using Nginx as a web server and haven't install any PHP and any module on the machines. When I analyzed the access logs, I got:

- - [26/Sep/2021:20:13:30 +0000] "POST /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1" 401 19 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
- - [26/Sep/2021:20:13:32 +0000] "GET / ...
Score: 0
Jack avatar
Find the absolute path for the root of the codebase
in flag

I need to find the absolute path for the root of the codebase.... is that a way to get it out easily??

I have a website that runs on on EC2 AWS/Ubuntu written at 95% in PHP and is linked with plesk. I use plesk because it keeps the management easy for me. Really losing my mind to get it. Based on this info can someone help?

Thanks for any support!

Score: 0
Mike Hermary avatar
Issues with CRON job executing on Ubuntu 20.04 with PHP 7.4 FPM
cn flag

I am having issues properly setting up the following CRON job to automate backups on my client's website.

The site is Joomla-based and I am using Akeeba Backup to handle the backups. The recommendations for the command-line CRON jobs are as follows:

Use the following command in your host's CRON interface: /path/to/php /var/www/domain.com/cli/akeeba-backup.php

Remember to substitute /path/to/php with ...

Score: 0
FireWallSP avatar
Crontab not running files
mx flag

I've been repairing a problem in my crontab, it ran all the files without any problem but suddenly it stopped running, it shows in the syslog that the file was executed but I did a test php that built a txt and writing that something inside I put it in cron and it shows in the syslog executed but it didn't open the php file, I noticed this in all the other files that have it.

Syslog:

Oct  1 08:32:53 c ...
Score: 0
naif basalib avatar
SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2746
cn flag

I'm using PHP Laravel 7.4 on Ubuntu 20.04 and trying to get data from SQL Server located on a Windows server in another cloud.

This method was tested on my PC (Windows) and it successfully retrieved the data from the Windows server. However, on my Ubuntu server, I follow the documentation from Microsoft and get this error:

SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]
TCP Provider: Error  ...