0

I got this demo http://www.coolphptools.com/color_extract#demo working in xampp on Windows. But now I want to use it on apache2 in Ubuntu. I installed apache2 and php 7 and put the files into /var/www/html/ But I think php is not working. It only shows the html part but nothing from the php code... Do I need to install something else?

I also ran

a2enmod proxy_fcgi setenvif
a2enconf php7.0-fpm
service apache2 reload

after installing php 7 but it doesn't work.

I thought it might be a problem with the php, because no php from the demo was working.
But when I add a simple php script to get the current time, that is working fine. So now I am even more confused what is causing this issue... Maybe it is a problem with the code? But why did it work fine on xampp?

I also double checked the answer on this PHP script not executing on Apache server post. And everything seems to be correct

2 Answers2

0

Type

sudo apt-get install apache2 php5 libapache2-mod-php5

will install everything you need and will start the apache server with support for PHP.

To verify that the php module is loaded, type:

a2query -m php5

if not enabled, then load with:

sudo a2enmod php5

and restart apache:

sudo service apache2 restart
0

Ok so I didn't notice,

Requirements:

PHP 4.0.2 or higher
GD2 image library

On the website of the demo. I had to run:

sudo apt-get install php7.0-gd

to implement the gd library.

Benny
  • 4,920