0

I have an application primarily written in PHP and using jQuery. I have a fresh CentOS VM where I copied application name RCCA under system-test/eabu-tools directory and created a link RCCA inside /var/www/html directory.

Contents of /var/www/html shown below.

lrwxrwxrwx 1 root root   27 Aug  6 12:04 RCCA -> system-test/eabu-tools/RCCA

Application Name is RCCA which have soft link called RCCA inside /var/www/html directory as shown above.

When I am accessing the application using url http://hostname/RCCA/rcca.php. All I am getting is a blank page and when I look at the source of the page I get the following output but nothing further, or includes are not working.

<body>
    <div id="header">
      <? include "header.php"?>
      <?php include "navbar.php" ?>
    </div>
    <div id="context_container">
        <div id="context_content">
            <div id="navi"></div>
            <div id="tabs-left">
                <? include("tabsTemplate.php");?>
                <div id="tabs-1" name="all-stats"> 
                    <div id="tabs-content"> 
                      <? include("all_rcca_sections.php");?>
                    </div>
                </div>
                <div id="tabs-2" name="stats1">
                    <div id="tabs-content"> 
                      <? include("rcca_sections1.php");?>
                    </div>
                </div>
                <div id="tabs-4">
                    <div id="tabs-content" name="stats2"> 
                      <? include("rcca_sections2.php");?>
                    </div>
                </div> ... so on.

Also, same directory structure and application is working fine on another server. Any idea what I am missing as first PHP deployment on fresh VM?

5
  • Looks like PHP is not running on the server, if you see php tags in browser. Also short open tags <? won't work on newer PHP versions. Commented Aug 25, 2015 at 19:21
  • @Alex2php, do i need to start any particular module to run php or any idea for backward compatibility? Commented Aug 25, 2015 at 19:30
  • 1
    Check if PHP is running on the server with php -v, if not you need to install it like sudo yum install php. Here is a complete guide to install a LAMP Stack with CentOS: digitalocean.com/community/tutorials/… Commented Aug 25, 2015 at 19:58
  • @Alex2php, Yes, php is running. Out put is [root@eabu-www-shell03 html]# php -v PHP 5.1.6 (cli) (built: Jun 27 2012 12:21:13) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies Commented Aug 25, 2015 at 21:07
  • @Alex2php "sudo yum install php" fix the issue. Please put in answer section so that i can accept it as an Answer. Commented Aug 25, 2015 at 21:14

2 Answers 2

1

If php code shows up in browser, PHP is not running as a (apache module) on the server. This is how you can install PHP on CentOS:

sudo yum install php

Also you should replace the short open tags, as they are disabled by default in newer PHP versions.

Sign up to request clarification or add additional context in comments.

Comments

0

Try to use <?php include ("file.php")?> in all includes.

1 Comment

What is the content in the file included? html tags and texts? Try to add <?php error_reporting(E_ALL); ?> at first line and check for results

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.