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


123
piaakitAsked:
Who is Participating?
 
Jan SpringerCommented:
Make sure that php is installed and configured for apache:

# which php
# ls -l /etc/httpd/conf.d/php.conf
1
 
NerdsOfTechTechnology ScientistCommented:
That means PHP isn't installed or is not yet configured to parse .php files. Check your httpd.conf file in Apache.
0
 
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
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy 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).
0
 
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.
0
 
piaakitAuthor Commented:
I remember under the owncloud, I can't find "data" folder, I only see below, any idea why ?

/var/www/HTML/owncloud/config



/var/www/HTML/owncloud/app
0
 
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.