I am trying to run a simple php code on my localhost and it seems to be acting wierd.
My HTML code
<html>
<head>
<meta charset="UTF-8">
<title>Cloud Computing</title>
</head>
<body>
<form action="url.php" method="post">
<table border="0">
<tr>
<td>Input</td>
<td align="center"><input type="text" name="username" size="30" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Submit"/></td>
</tr>
</table>
</form>
</body>
</html>
my PHP code
<html>
<head>
<meta charset="UTF-8">
<title>PHP Test</title>
</head>
<body>
<?php
date_default_timezone_set('America/Los_Angeles');
echo date_default_timezone_get() . ' => ' . date('e') . ' => ' . date('T');
?>
</body>
</html>
My Localhost Screenshot
Tried
- http://howtoubuntu.org/how-to-install-lamp-on-ubuntu
- Ran
php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'
Results inYour PHP installation is working fine.
- Restarted the server
- Referred Derek Banas's video on youtube and both the code seems fine.
Its weird as neither does it print the whole code and neither does it execute it.
Kindly help , I am using ubuntu 16.04, running my localhost from ubuntu itself.
I tried the solutions here too. Maybe I am doing something wrong (Newbie Alert !)
<?php
right? – Cyber_Star Mar 06 '17 at 09:15America/Los_Angeles => America/Los_Angeles => PST
. Check your installation .. – Abdulla Nilam Mar 06 '17 at 09:19PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.15-0ubuntu0.16.04.4, Copyright (c) 1999-2017, by Zend Technologies
– Pandeyji Mar 06 '17 at 09:20I am running the server in ubuntu ( Not using XAMPP or WAMP) How can I check the php config for that?
Sorry I am new to this !
– Pandeyji Mar 06 '17 at 09:22