0

Now I'm migrating my site to new server where the site was not working properly. after I debug the issue, its due to "php include not working".

so I did some testing to find the issue. for that. I just create simple html file with include tag

file name : test1.php file content:

<html lang="en">
<? include 'webcss.php' ?>
</html>

New server: Executing the file through cli

[root@localhost test]# php test1.php 
<html lang="en">
<? include 'webcss.php' ?>
</html>
[root@localhost test]#

Existing server : Executing the same cli command. it shows the output.

[root@www test]# php test1.php 
<html lang="en">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css"> <!-- TO SHOW ARROWS -->
<!--  FONTS  -->
<link href='http://fonts.googleapis.com/css?family=Lato:400,300,900,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="style/font-awesome.min.css" />
<!--  //FONTS  -->

<!--  JQUERY CSS  -->
<link rel="stylesheet" type="text/css" href="style/jquery/flexslider.css" />
<!--  //JQUERY CSS  -->

<!--  ANIMATE CSS  -->
<link rel="stylesheet" type="text/css" href="style/animate/animate.css" />
<!--  //ANIMATE CSS  -->

<!--  SWITCH COLOR RIGHT PANEL CSS  -->
<link rel="stylesheet" type="text/css" href="style/switch.color.css" />
<!--  //SWITCH COLOR RIGHT PANEL CSS  -->

<!--  CSS  -->
<link rel="stylesheet" type="text/css" href="style/bootstrap/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="style/style.css" />
<!--  //CSS  -->

<!--  THEMES COLOR STYLE  -->
<link rel="stylesheet" type="text/css" href="style/template_bg/light.background.css" />

<link rel="stylesheet" type="text/css" href="style/template_color/yellow.color.css" />
<link rel="stylesheet" type="text/css" href="style/template_color/turquoise.color.css" />
<link rel="stylesheet" type="text/css" href="style/template_color/pink.color.css" />
<link rel="stylesheet" type="text/css" href="style/template_color/purple.color.css" />
<link rel="stylesheet" type="text/css" href="style/template_color/green.color.css" />
<link rel="stylesheet" type="text/css" href="style/template_color/red.color.css" />
<link rel="stylesheet" type="text/css" href="style/template_color/blue.color.css" />
<link rel="stylesheet" type="text/css" href="style/template_color/lightgreen.color.css" />
<link rel="stylesheet" type="text/css" href="style/template_color/lightred.color.css" />
<!--  //THEMES COLOR STYLE  -->

</html>
[root@www test]#

Both servers are same hardware, Operating system and php version. I don't know what was the reason for the same code not running on new server.

Someone please help to fix this issue. so that I can move my site to new prod datacenter.

Note : I verified the php settings on both servers by using phpinfo. both are same.

I don't have any idea what parameters I need to check.

OS: CentOS 7

PHP : 5.4.16

KMG
  • 889
  • 2
  • 14
  • 36

1 Answers1

2

Try <?php include 'webcss.php' ?> not <? include 'webcss.php' ?> because, as said in the php doc, it's discouraged

t-n-y
  • 1,201
  • 2
  • 13
  • 27