Questions tagged [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.

Filter by
Sorted by
Tagged with
235 votes
2 answers
321k views

How do I install different (upgrade or downgrade) PHP version in still supported Ubuntu release?

I am trying to update to install PHP 5.5, 5.6 or 7.0 in Ubuntu 12.04/14.04/16.04 LTS, and I can only get PHP 5.3.10 for Ubuntu 12.04, PHP 5.5.9 for Ubuntu 14.04 or PHP 7.0.4 for Ubuntu 16.04 using ...
kavisiegel's user avatar
  • 2,507
182 votes
4 answers
598k views

How can I downgrade from PHP 7 to PHP 5.6 on Ubuntu 16.04? [duplicate]

I am trying to revert my PHP version to 5.6 from 7 and though I removed PHP 7 and then installed PHP 5.6 I still seem to be running version 7. Is there a simple method for moving through PHP versions ...
dibs's user avatar
  • 3,489
70 votes
7 answers
382k views

PHP script not executing on Apache server

I have just reinstalled Apache and PHP5 but when I visit my doc root it just downloads a "download" file. And when I try documentroot/index.php it just downloads the PHP file. I have PHP installed ...
user2919631's user avatar
9 votes
1 answer
10k views

WordPress Installation Failed

I am trying to install Wordpress on Lubuntu. I followed the instructions here. Including PHP Apache and MySQL setups. Apache and MySQL appear to be running fine. However, when I go to http://...
TeKola's user avatar
  • 91
158 votes
4 answers
536k views

Installing PHP 5.6 on Xenial (16.04) [duplicate]

I need to use php5 (5.6) because I'm working on a Drupal 7 project which doesn't support php7. The problem is I recently updated to ubuntu 16.04 Xenial which seems to no longer support php5. I tried ...
Nikolai's user avatar
  • 1,683
20 votes
4 answers
46k views

PHP rendered as text after Ubuntu 16.04 upgrade

Apache is rendering PHP files as text after Ubuntu 16.04 upgrade. Apache is installed and running. PHP7 is running. When I execute the following command I get the correct output: php -r 'echo "\n\...
machadoug's user avatar
  • 267
123 votes
9 answers
531k views

How to install PHP 7?

PHP 7 came out yesterday and I would like to give it a try. PHP 7.0.0 comes with a new version of the Zend Engine, numerous improvements and new features such as Improved performance: PHP 7 is up to ...
hg8's user avatar
  • 13.5k
54 votes
2 answers
300k views

Can't install php5 on Ubuntu 16.04

so I've recently installed my first Ubuntu, to be precise, a daily build of 16.04, on my new laptop since the hardware was to new for 15.10. Now I'm in the process of setting it up and I want to ...
user529857's user avatar
48 votes
5 answers
212k views

default permissions for /var/www

I was trying to open a file and write to it with PHP at /var/wwwfolder but it wasn't working so I did sudo chmod 777 /var/www now I want to set the permissions for /var/www to the default. what are ...
Hossein Hosseinvand's user avatar
36 votes
4 answers
192k views

Installing PHP 5.3 in Ubuntu 14.04

I've just installed Ubuntu 14.04 and am trying to install php 5.3. But when I run apt-get install php5 it's installing php 5.5.9-1ubuntu4. I need to use php 5.3 in the system because the ...
Chathruaka Waas's user avatar
11 votes
4 answers
13k views

Install Apache, Php, Mysql latest versions not available via apt

I need to install the latest versions of apache, php and mysql that are available on their websites, but the problem is that apt repositories don't have these updates versions yet. Versions that I ...
Tarun's user avatar
  • 4,245
220 votes
7 answers
951k views

Find the correct php.ini file

I am currently trying to locate the correct php.ini file to edit it and restart apache so the changes will take place and I'm stumped. I have found three different php.ini files (no idea why there ...
Michael's user avatar
  • 2,303
95 votes
10 answers
665k views

How to completely remove PHP?

I need to clean up my server from PHP 5.3 packages (there are plenty of them) in order to be able to compile PHP 5.2. What is the easiest/safest method to get rid of them all?
corev's user avatar
  • 1,317
77 votes
12 answers
182k views

How to have two versions of PHP installed and switch easily between them?

I want to have both PHP 5.2.17 and PHP 5.3.5 installed on my Ubuntu machine and switch as per my necessity. How can I achieve this?
Debiprasad's user avatar
55 votes
2 answers
520k views

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? [duplicate]

I am using ubuntu 13.10 on evaluation board and my internet is not working. Also i need to install softwares and apt-get install is also not working. Terminal says : E: Unable to fetch some archives,...
mong cape's user avatar
  • 559
22 votes
4 answers
58k views

Upgrade to the latest PHP version in Ubuntu

I am using NextCloud in my server and NextCloud informs me that: You are currently running PHP 7.0.32-0ubuntu0.16.04.1. Upgrade your PHP version to take advantage of performance and security ...
yaylitzis's user avatar
  • 731
18 votes
5 answers
94k views

How to downgrade from PHP 5.4 to 5.3

Recently I upgraded PHP to 5.4, but it seems to be failing on me because APC isn't working with it, however this gave me no choice but to downgrade to 5.3, how can I do this? I executed apt-get ...
MacMac's user avatar
  • 281
7 votes
3 answers
10k views

How to install php7.4, 5.6 ubuntu 21.10

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 ...
mahdiakkk's user avatar
113 votes
14 answers
354k views

Mcrypt extension is missing in 14.04 server for mysql

The php mcrypt extension on ubuntu 14.04 shows that it is installed properly, but phpmyadmin says: The mcrypt extension is missing. Please check your PHP configuration. My current php config is ...
matthapkidokarate's user avatar
94 votes
5 answers
517k views

How to solve the phpmyadmin not found issue after upgrading php and apache?

Recently I have install the PHP, Apache, MySQL, phpMyAdmin, python in my Ubuntu Desktop 12.04.3 LTS to use it as a LAMP server. The commands I used to install these are given below: 1: sudo passwd 2: ...
Farukh's user avatar
  • 1,063
75 votes
7 answers
242k views

How to have my PHP Send mail?

I installed Ubuntu 11.04, LAMP using tasksel. I find that PHP mail() does not work. I suppose I need to enable it or something? How do I do that?
JM at Work's user avatar
  • 1,965
68 votes
1 answer
187k views

Upgrade to the specific php 7.1/7.2 from php 7.0 in Ubuntu 16.04 [duplicate]

How can I upgrade to php 7.1 from php 7.0 in ubuntu 16.04 ? If I do a php -v I get this message: PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, ...
Michele Carino's user avatar
35 votes
10 answers
81k views

What are some good PHP editors? [closed]

I'm currently using PhpStorm by Idea JetBrains, but its buggy and I'm really looking for something that will allow me to get work done without too much hassle. Please limit one IDE/Editor an answer.
10 votes
3 answers
91k views

Apache2 start error when using php5 module ( Ubuntu Server)

I am using Ubuntu Server. When I start apache2 everything is fine, but when enabling php5 module and restarting apache2 I get this error: ERROR: *** Restarting web server apache2 ...
Joserex65's user avatar
  • 221
3 votes
1 answer
1k views

Cronjob saves json into a wrong directory [duplicate]

There is a Cron job on Ubuntu 16.04 which runs a PHP script $parseinfo = 'parseme.json'; $handle = fopen($parseinfo, 'w'); fwrite($handle, json_encode($res)); to parse data into a JSON file. The PHP ...
vNottbeck's user avatar
97 votes
5 answers
603k views

How do I upgrade PHP version to the latest stable released version?

I'm using a system running on Ubuntu 12.04 LTS 64-bit OS. I'm currently using following PHP version on this machine: Command used to get the below info at terminal : php -v Details I got are as ...
PHPLover's user avatar
  • 1,787
71 votes
7 answers
212k views

Upgrade to 16.04. php7 not working in browser

I just upgraded from 14.10 to 16.04 and am not sure how to configure PHP 7 in apache. I did modify the php7.0.conf file to uncomment that last lines, restarted apache2 and no change. Do I need to ...
David Wright's user avatar
37 votes
5 answers
181k views

Install PECL packages on ubuntu

I've tried it a 100 times I'm really new to Ubuntu and ended with a bunch of error that I don't even understand can any one please help me?? Here is what I did: I installed PHP I installed libcurl ...
maniteja's user avatar
  • 481
21 votes
3 answers
147k views

mbstring is missing for phpmyadmin in ubuntu 16.04

When I installed phpmyadmin in Ubuntu 16.04 LTS, it gives me an error mentioned below. The mbstring extension is missing. Please check your PHP configuration then I tried to install php-mbstring, ...
Mohamed Saleem's user avatar
13 votes
3 answers
37k views

How can I configure Postfix to send all email through my Gmail account?

I'm trying to send an email through Google from my localhost. (via PHP5.3) But Google keeps on blocking my requests. I tried to follow the solutions given to a few similar questions, but for some ...
gmadar's user avatar
  • 233
8 votes
3 answers
38k views

Default file permissions for php user www-data

I have a php installed on my ubuntu machine. The web root is /var/www I set the permissions for this folder like so: sudo chown -R ftpuser:www-data /var/www ftpuser is the user I set up so I can ...
JD Isaacks's user avatar
  • 5,277
6 votes
1 answer
10k views

How to build PHP 7.3?

I have a problem with building the package for PHP 7.3 from git. At the moment I am using Ubuntu 16.04 with utdatet php 7.0.x. (It's impossible to upgrade Ubuntu 16.04 to 18.04 at my VPS, because it ...
roket's user avatar
  • 73
6 votes
2 answers
61k views

How to downgrade PHP from 5.5.9 to 5.4 in Ubuntu 14.04 (Installed with LAMP)

I need to downgrade my PHP version from 5.5.9 to 5.4 (using Ubuntu 14.04), because I have a code that's using mySQL (which is deprecated in 5.5.9), and I cannot change that code. Is there a way to do ...
Hagaymosko's user avatar
3 votes
1 answer
4k views

Executable runs without sudo but not with sudo

I installed xampp in my system in the location /opt/lampp. After that I added the php location to my path variable using export PATH=$PATH:/opt/lampp/bin So when I run php -v using terminal I get ...
Mahendran Sakkarai's user avatar
2 votes
4 answers
11k views

php script not executed by crontab

I have setup a cron to execute one of my php scripts. But the problem is the php script is not being executed at all not even partially. Here is the cron I have set up 45 23 * * * /usr/bin/php -q /...
Tarun's user avatar
  • 4,245
2 votes
10 answers
19k views

How to downgrade PHP from 5.3.x to 5.2.x

I need to downgrade my PHP to 5.2.x from 5.3.x Certain software I currently use requires it. I found all these link explaining how to do it but they no longer work because they show you how to use ...
Wavesailor's user avatar
0 votes
1 answer
2k views

.php files are downloaded instead of being parsed by Apache

I have Xampp on Ubuntu 11.04. .php files are downloaded instead of parsed by Apache! How do I get Apache to parse them?
oiko's user avatar
  • 29
145 votes
3 answers
405k views

What is the easiest way to enable PHP on nginx?

What is the easiest way to enable PHP on nginx on Ubuntu 12.04? Best solution is the one that request minimal work, ideally just a package installation :)
sorin's user avatar
  • 9,868
39 votes
4 answers
187k views

How to configure Apache to run PHP as FastCGI on Ubuntu 12.04 via terminal?

I'm relatively new to the world of unix command line web server management/administration. Many hosts with control panel administration options allow you to change how PHP is run with a simple option....
Evan Mattson's user avatar
30 votes
4 answers
135k views

php-mcrypt package missing in Ubuntu Server 18.04 LTS

Is the php-mcrypt package missing in Ubuntu Server 18.04 LTS? apt install php-mcrypt Reading package lists... Done Building dependency tree Reading state information... Done Package php-mcrypt is not ...
Andrea Rossetti's user avatar
25 votes
4 answers
92k views

Unable to install PHP 7.3 on Ubuntu 20.04

I want to install PHP 7.3 on Ubuntu 20.04 for my Nginx web server, when I try to install the 7.4 version everything is fine but for 7.3 I get the following error: E: Unable to locate package php7.3 ...
Farshad's user avatar
  • 361
24 votes
2 answers
30k views

PHP and Apache2 broken after upgrade to Ubuntu 16.04

I've been having a lot of trouble fixing up the remains of my server after upgrading to Xenial yesterday. PHP apps run as a mess of code, and ownCloud 'can't be found on the server' anymore. It may ...
Nectar's user avatar
  • 1,969
20 votes
9 answers
51k views

phpmyadmin not working due to missing extensions

I am about to use phpmyadmin on Ubuntu 16.04. But it shows that the page is not working. the error log says error 500 PHP Fatal error: require_once(): Failed opening required '/usr/share/php/php-...
kepalabotak's user avatar
16 votes
8 answers
40k views

PHP is not working well on Ubuntu 13.10 and mcrypt is missing in phpmyadmin

I've upgraded from UBUNTU 13.04 to 13.10 but I can not work with PHP pages or phpmyadmin . I've tried this way to install lamp on Ubuntu sudo apt-get install lamp-server^ phpmyadmin and I've done all ...
Mohammad_Hosseini's user avatar
13 votes
4 answers
15k views

PHP not working after upgraded to Ubuntu 17.10

After I upgraded to Ubuntu 17.10, PHP totally stopped working. Everything works fine in Ubuntu 17.04. The code for info.php as follows does not work: <?php phpinfo(); ?> It is not showing ...
Shen Hongliang's user avatar
8 votes
3 answers
81k views

can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' [duplicate]

I just installed appache, MySQL and PHP, suring my installation, I was prompted for a MySQL root user password, but when I start my MySQL, it pops the error, and I just can't seem to find a way around ...
pamodulus's user avatar
3 votes
2 answers
13k views

How to fix error processing package git-daemon-run? [duplicate]

I am trying to install php curl like so: sudo apt-get update sudo apt-get install php5-curl But I keep getting an error. Reading package lists... Done Building dependency tree Reading state ...
Waqleh's user avatar
  • 871
2 votes
1 answer
817 views

phpmyadmin doesn't connection with true data

I install mysql and phpmyadmin and in installation phpmyadmin i add config password is root but in connection with user is root and password is root i have this error
dev2019's user avatar
  • 23
1 vote
4 answers
21k views

Install PHP 5.3 on Ubuntu 13.04

How I could install an old PHP version on Ubuntu 13.04 (Raring Ringtail) -preferably version 5.3.3?
Blaze's user avatar
  • 123
0 votes
2 answers
5k views

How to install PHP5.6 when using apache2.4.28 complile from source on Ubuntu 16.04?

I try to compile Apache 2.4.28 from source, I can't use command apt-get install apache2 Because this command install Apache 2.4.18 only. Here is my install step: Install dependency apt-get ...
ThanhLam112358's user avatar

1
2 3 4 5