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.

learn more… | top users | synonyms (2)

173
votes
2answers
244k 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 ...
85
votes
14answers
28k views

What's the easiest way to set up a LAMP stack?

I set up a new VPS instance of Ubuntu and am wondering what the easiest way is to get up and running with a basic LAMP stack (i.e. which packages are required, which configuration options need to be ...
19
votes
2answers
43k 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 ...
35
votes
2answers
44k views

Installing PHP 5.6 on Xenial (16.04)

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 ...
11
votes
4answers
11k 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 ...
9
votes
2answers
5k 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\...
49
votes
6answers
94k 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 ...
31
votes
4answers
41k 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 ...
18
votes
5answers
84k 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 ...
47
votes
6answers
144k 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?
23
votes
3answers
111k 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 ...
28
votes
10answers
57k 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.
95
votes
10answers
228k 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 ...
83
votes
2answers
163k 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 :)
23
votes
4answers
76k 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 ...
8
votes
2answers
26k 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 ...
7
votes
3answers
31k 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 ...
2
votes
10answers
17k 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 ...
13
votes
7answers
46k views

Unable to set password for the mysql “root” user

I am new to Ubuntu. I am running Ubuntu 12.10. I am trying to install apache,php,mysql. However I have installed apache and it is running perfectly. sudo apt-get install apache2 But when I tried to ...
0
votes
1answer
1k 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?
0
votes
1answer
159 views

How To Set Up the Ubuntu 14.* Included X-Windows(xUbuntu) / MySql / PHP (Apache 2 ) In VMware

I had used Linux system for near decade , but now I need to use it again because I want to use more open resources and try to use like DevOpe solutions so that I hope I can give me some notices and ...
24
votes
3answers
102k 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....
12
votes
8answers
18k 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-...
4
votes
1answer
2k 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 ...
3
votes
2answers
4k views

How to fix error processing package git-daemon-run?

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 ...
2
votes
1answer
309 views

Send an email from the localserver using PHP

I am trying to send an email to my thunderbird or google acount using PHP from a local server in Ubuntu. I have used the mail() function in PHP. I have done some research and apparently you can not ...
107
votes
3answers
317k views

Where are the Apache and PHP log files?

I've installed Apache, PHP, and MySQL on Ubuntu 10.10 desktop edition, and it's working fine. Except I have no clue where to look for Apache or PHP log files.
34
votes
5answers
139k 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: ...
42
votes
5answers
68k views

How to have two version of PHP installed and switch easily?

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?
13
votes
3answers
65k views

default permissions for /var/www

I was trying to open a file and write to it with PHP at /var/www folder 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 ...
17
votes
4answers
19k 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 ...
15
votes
8answers
38k 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 ...
23
votes
3answers
84k views

Update server php version to 5.4.10 via the command line

Im setting up a vps for the first time from scratch, the host has a one click LAMP installer which took out allot of the leg work, but running phpinfo(); i found im running 5.3.10. So id like to ...
8
votes
3answers
27k 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 ...
4
votes
2answers
44k 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 ...
21
votes
4answers
20k views

When will PHP 5.6 be in the official Canonical repos?

I imagine it won't up until 14.10 is released, but even if that is the case, could we expect to see it show up in the repos that 14.04 uses?
10
votes
4answers
6k views

How to rollback to PHP 5.2?

I have just installed a 10.04 LTS on my development server but the system that I need to run on it (Magento ecommerce) is not compatible with PHP 5.3 which ships with the newest version of Ubuntu. Is ...
7
votes
3answers
8k views

How to enable SFTP Support in cURL?

I have installed curl-7.27.0 and it is working fine how ever it is not working is run below command to find whether it is now, but it showed that : Result of the command curl -V root@ubuntu:~/...
5
votes
4answers
60k views

Run PHP from the command line

I have installed XAMPP v1.8.3 for my PHP development. I am new to Ubuntu, so I don't know how to set environment variable for PHP which is located at /opt/lampp/bin/php. I can run PHP scripts from ...
0
votes
3answers
1k views

How to access a website under Ubuntu

I am newbie to Ubuntu and trying to migrate from Windows but there is something I can't understand in web developing. In windows I just install the server and make a folder in the www folder or ...
8
votes
2answers
10k views

PHP and MySQL not communicating

I have come to the conclusion that my PHP installation and my MySQL installation are not getting along; I’m working on making my first web page that uses MySQL for content, but after two days, man ...
5
votes
3answers
9k views

Downgrade PHP to PHP5.2?

I want to install PHP 5.2 in Ubuntu 11.04 , I had some script that did that thing good but only on Ubuntu 9, anyone has a script / instructions how to do it?
4
votes
1answer
14k views

Easiest way to upgrade php to latest version? [duplicate]

I'm seeing info on how to upgrade from a specific version to another, and that is what I want to do (currently 3.3.6), but is there a simple command to do this? I'm a complete ubuntu/linux noob so I ...
2
votes
2answers
6k views

Downgrade PHP 5.6 to PHP 5.5

I installed Ubuntu 15.04, but I need to use PHP 5.5 and in 15.04 the standard is PHP 5.6 I added the PPA: sudo add-apt-repository ppa:ondrej/php5 But when I tried to install, I got: The following ...
1
vote
2answers
3k views

500 Error on index.php file

I have found a question very similar to this, which I thought would solve my problem. However, after changing my .htaccess file, with index.php on the end of the list, and then index.php as the only ...
4
votes
1answer
6k views

How to recover the default php.ini

I accidentally deleted php.ini from /etc/php5/apache2. How to recover it? I tried to remove and install php5 without luck.
3
votes
4answers
17k views

Upgrade PHP version to 5.3 on Ubuntu

How can I do a version upgrade from 5.2 to 5.3? php update/upgrade is saying I'm using the latest version. I'm using Ubuntu Server 9.04
3
votes
3answers
17k views

Call a shell script from PHP, run as root

I'm running ubuntu 11.10. I want to be able to call a shell script from php and run that script as root. When my php attempts to call the shell script as root --like this: $output = shell_exec('sudo ...
1
vote
1answer
2k views

Whay apache2 does not process PHP files?

I have installed Apache server using TaskSel from Synaptic package manager. I did the following: sudo a2enmod php5 Module php5 already enabled sudo a2enmod userdir Module userdir already enabled ...
0
votes
3answers
1k views

Shell Scripting for Linux Server Administration

I recently started learning Linux(Ubuntu), and i'm aware that Linux has it's own form of language i.e Shell Scripting. What i'll like to know is that is this language enough to administer a Linux ...