I recently wanted to create a subdomain on my 1&1 hosting package that also used the latest version of PHP to boot. Whilst the web portal at 1&1 is quite full featured, it can also be a little hard to navigate so that is why I have documented the steps I took below.
To begin, let’s assume that you have logged into the portal and are ready to begin.
Creating the Subdomain
- Click on Domains on the left navigation bar.
- Click on the cog wheel to the right of the domain on which you want to add your subdomain.
- Choose manage subdomains.
- Click on Add subdomain, under the Create Subdomain sidebar on the right.
- Type in the subdomain name and click save.
Connect Folders to Host the Subdomain
- You will see it say under status, Use Your Domain. Click on that.
- Click on Connect to Webspace.
- Either browse to an existing folder or create one using the New Folder button in the bottom right.
- Click on the tick mark, then Save.
Setting the PHP Version
- Back to the main left navigation list, choose Web Hosting.
- Now click on PHP Settings. It’s slightly greyer on my screen, just under the MySQL Database.
- Find your subdomain, then click on it.
- Choose the PHP version you require – newest is usually for the better.
- Click Save.
Testing the PHP Version
If you now go to this subdomain (for me, that would be: http://webapps.logicalmoon.com), you might be disappointed. Did it work at all?
Well, if you now use SSH to go to the folder which was created and add an index.php file, you can confirm that all is well and that you are indeed using the version of PHP you selected.
- cd logicalmoon/webapps (your folder will differ)
- nano index.php
- Add in: “<?php phpinfo();” without the quotes, and save the file (control-O, enter, control-X)
- Visit the subdomain in your browser and you should see that a) it is working and b) that the correct version of PHP is installed.
- Now remove the index.php file – you don’t want to leave all the other details that are shown there, visible.
That will get you started but of course, there is much more to do to have a fully working web application or site, which I will touch upon in another post.
Written by Stephen Moon
email: stephen at logicalmoon.com