LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-07-2016, 07:54 AM   #1
dushyantg
Member
 
Registered: Jun 2016
Posts: 70

Rep: Reputation: Disabled
Apache not executing .php files


hi,

i have cent os 7 installed on my machine. also installed xampp on it. when i tried to open .php file on browser its not executing but when i try to executi .html file on browser it displayed.


can anybody help me out in resolving this???


Thanks
 
Old 06-07-2016, 08:38 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Your security configuration is very likely the default.


I believe to need to enable "httpd_builtin_scripting" (check the manpage on setsebool). The command to set this is
Code:
setsebool -P httpd_builtin_scripting 1
I believe you will have to restart the http server after this for it to become active.
 
Old 06-08-2016, 02:49 AM   #3
dushyantg
Member
 
Registered: Jun 2016
Posts: 70

Original Poster
Rep: Reputation: Disabled
se is disabled

Last edited by dushyantg; 06-08-2016 at 03:02 AM.
 
Old 06-08-2016, 03:16 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,309
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by dushyantg View Post
se is disabled
Then you're probably going to be better off trying a normal LAMP stack instead of experimenting with XAMPP. XAMPP is pretty non-standard and will cost a lot of extra work just to get running, then there are extra maintenance considerations that you will run into because it does not take advantage of the built-in package management system that CentOS uses. To get normal LAMP components, use yum. The packages httpd, mariadb, perl, and php will add what you need. Linux you have already and python should already be installed by default. Then it will be less work to get running, lower effort for maintenance, greater portability, and also give you the ability to take advantages of the guides and tutorials out on the net.
 
2 members found this post helpful.
Old 06-08-2016, 05:09 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by Turbocapitalist View Post
Then you're probably going to be better off trying a normal LAMP stack instead of experimenting with XAMPP. XAMPP is pretty non-standard and will cost a lot of extra work just to get running, then there are extra maintenance considerations that you will run into because it does not take advantage of the built-in package management system that CentOS uses. To get normal LAMP components, use yum. The packages httpd, mariadb, perl, and php will add what you need. Linux you have already and python should already be installed by default. Then it will be less work to get running, lower effort for maintenance, greater portability, and also give you the ability to take advantages of the guides and tutorials out on the net.
And less security.

SELinux is there for protection. If you aren't going to use it, you may as well use any other distribution.
 
1 members found this post helpful.
Old 06-08-2016, 05:58 AM   #6
dushyantg
Member
 
Registered: Jun 2016
Posts: 70

Original Poster
Rep: Reputation: Disabled
i have disabled just to check it and resolved it but not working in any way..
 
Old 06-08-2016, 05:59 AM   #7
dushyantg
Member
 
Registered: Jun 2016
Posts: 70

Original Poster
Rep: Reputation: Disabled
as you said i also planning to move on to the lamp stack but its been configured by someone else and without any further instructions i cant switch so i am trying to resolving this issue only
 
Old 06-08-2016, 06:20 AM   #8
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,309
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
You can spend your resources just to try to get XAMPP running. Or you can use "yum" to install httpd, mariadb, perl, and php and spend your resources building something with perl, python, or php. Can you run "yum" on your machine to install anything? Or can your sysadmin do so on your behalf? If so, then that is the way to go.
 
Old 06-08-2016, 06:33 AM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Note: the CentOS packages work - they have any patches needed, and already have the security designes configured for CentOS, where the xampp kit is not, and will not.
 
Old 06-08-2016, 06:37 AM   #10
dushyantg
Member
 
Registered: Jun 2016
Posts: 70

Original Poster
Rep: Reputation: Disabled
yes i can yum on my machine
 
Old 06-09-2016, 12:52 AM   #11
dushyantg
Member
 
Registered: Jun 2016
Posts: 70

Original Poster
Rep: Reputation: Disabled
finally i have reloaded my server and its only having cPanel but still facing issue with error 500
 
Old 06-09-2016, 07:13 AM   #12
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,309
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by dushyantg View Post
finally i have reloaded my server and its only having cPanel but still facing issue with error 500
Ok. Does that mean you have used yum to install the packages httpd, mariadb, perl, and php? Once you have installed the php package, you'll need to get the web server to reload its configuration file.

Code:
systemctl restart httpd.service
If you are still getting a 500 error, then try opening a new window and tracking the web server's error log:
Code:
tail -f /var/log/httpd/error_log
What is the exact error when you try to load the offending page?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache disallow executing php using htaccess - how? postcd Linux - Server 1 06-25-2014 12:49 PM
apache and/or php executing arbitrary code bombuzal Linux - Security 5 05-08-2010 02:22 PM
Apache/PHP: Executing 'at' scheduled jobs? bomix Linux - Software 11 01-23-2009 01:02 PM
apache php - executing commands using system(), problems Sambojambo Programming 3 05-29-2008 11:52 AM
How to prevent apache from executing certain files imi@tux Linux - Server 3 09-21-2007 12:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration