I read about a php.ini file. Do I need that? Also I can not find a php log file to look for errors.

The php.ini file should be in the same directory that PHP was installed in, I have never heard of anyone needing to create the file themselves. The 'php-errors.log' file should be in your temp directory, the php.ini file points to the directory.

Are you running the script from a local web server OR from your online web server?

I read about a php.ini file. Do I need that? Also I can not find a php log file to look for errors.

The php.ini file should be in the same directory that PHP was installed in, I have never heard of anyone needing to create the file themselves. The 'php-errors.log' file should be in your temp directory, the php.ini file points to the directory.

Are you running the script from a local web server OR from your online web server?

I have my own webspace. I do not install PHP. I do not have a temp directory. It is being run from an online web server (1and1)

I guess you should ask your hosting company where the INI and ERROR files are located. I can login to my account and have access to that information.

If you really want to learn PHP you should install a web server on your local computer. That way you KNOW when a script works correctly and can talk to your hosting company about it. I know nothing about 1and1.