See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

PHP script not executing on Apache server. U-18.4 PHP 7.2 Localhost

General Tech Bugs & Fixes
Max. 2000 characters

Karlie Kloss


( 7 months ago )


My Apache is running and displays the Default Page. I can redirect a PHP file into php and the echo command displays properly. I've already researched previous versions of Ubuntu and can't find any solution.

a2query -m php7.2  -> Enabled by maintainer script

In /etc/apache2/mods-avaliable/php7.2.conf

These lines have been commented.
 Running PHP scripts in user directories is disabled by default
 To re-enable PHP in user directories comment the following lines
 (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
 prevents .htaccess files from disabling it.
  Commented following lines.
<IfModule mod_userdir.c>
    <Directory /home/*/public_html>
        php_admin_flag engine Off

The classic phpinfo.php processes but no output is provided by Apache. i.e. php < phpinfo.php lists all the information.

I believe that there is a setting required and/or a value not set. This resulted after upgrading from Ubuntu 15.04 to Ubuntu 18.04. Any help would be appreciated.

Deepak Parmar


( 7 months ago )

In file /etc/apache2/envvars the user and group were not correct. changed export APACHE_RUN_USER=www-data to myname and changed export APACHE_RUN_GROUP=www-data to myname

Other changes were made to the apache configuration file to get phpmyadmin to work, but that's another story.

what's your interest