PHP pages wont load in centos 7, it shows only the Source Code

after I ran below, my owncloud become like this, any idea how to fix it ?

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/data'
restorecon '/var/www/html/owncloud/data'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/config'
restorecon '/var/www/html/owncloud/config'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/apps'
restorecon '/var/www/html/owncloud/apps'

setsebool -P httpd_unified 1
setsebool -P httpd_execmem 1

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NerdsOfTechTechnology ScientistCommented:
That means PHP isn't installed or is not yet configured to parse .php files. Check your httpd.conf file in Apache.
piaakitAuthor Commented:
Sorry I'm new in centos, just wonder what should I check in http.conf ? Before the index.php could show after I ran those command it won't show anymore its only show the source code instead , any help would be appreciated
Jan SpringerCommented:
Make sure that php is installed and configured for apache:

# which php
# ls -l /etc/httpd/conf.d/php.conf

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

NerdsOfTechTechnology ScientistCommented:
If it ran before, it sounds like you have php installed. Now you might need to fix permissions on the file you are running or its folder (via CHMOD) to make sure OWNER and GROUP are set appropriately for permissions (for example, 644 for files, 600 for include files, and 755 for folders); also, check your .htaccess if there's one in the folder (it might have directives that are making your php not parse).
Jan SpringerCommented:
Also check selinux:

# ls -ldZ /var/www/html/owncloud/data
# ls -lZ /var/www/html/owncloud/data

Check the selinux permissionions and update.

# chcon -R -t httpd_sys_rw_content_t /var/www/html/owncloud/data

Do this for each directory.
piaakitAuthor Commented:
I remember under the owncloud, I can't find "data" folder, I only see below, any idea why ?


NerdsOfTechTechnology ScientistCommented:
The solutions provided should help fix the primary issue of PHP files not being parsed. As for the secondary question, the OP is urged to post it separately.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.