I use PhpStorm which handles javascript as well. If you do not need the php-side of it, they also have an IDE called WebStorm, but I don't really know what differences there might be between those two applications though. Apart from code completion they have support for jshint / jslint which will enforce you to write good javascript code. It may be a bit more work initially, but it is definitely worth it. There are things you are better off learning sooner rather than later.
You'd have to check that apache is running and is properly configured. Apache may not be running. It may not be listening on port 80. It may not be configured to map to your htdocs folder. It may not treat .php files as php files. If you point your browser to localhost/your-php-file-for-server-time, what output do you get? Are there any error messages in your apache log file?
I'd also check the publish date on your book. While it may be that they will get to these things later, it could also be that the book is using ways of doing things that you should not (generally) do. If they don't deal with these topics at all, I'd advice you to find another source of information. For example, adding event handlers by property assignment will overwrite any existing event handlers for that object.
window.onload = previousHandlersErased;
someDOMNode.click = previousHandlersErased;
Another example is that it may be suitable from a teaching perspective to deal with XML documents. However, if your server sends content intended for non-human processing, it'd be better to use JSON. I.e.
serverside
echo json_encode(array('server-time' => date('H:i:s:')));
clientside
function cback(text) {
alert('Server time is ' + JSON.parse(text)['server-time']);
}
However, JSON.parse was added in javascript 1.7 and may not exist in older browsers.
And you'd be well adviced to NOT end your php files with a php closing tag. Php parsing will end at end of file if the closing tag is missing. If it is present, you risk adding white-space output.
<?php
guaranteed_no_trailing_whitespaces_output();
<?php
trailing_whitespace_output();
?>