The Database Cannot Be Published Error can arrise from two typical issues. Both of these issues come from the Web Server.
The first step to take in fixing this issue is to confirm the Web Server's contribution to the Error. Begin with opening the Database in designer mode and checking is the Web Server is being Launched During Startup. If it is disable this setting and reopen the database to see if the error appears or not. If it does not then the cause of the issue is due to the Web Server which is ussually caused by one of two errors.
Disable the Launch Web Server at Startup setting and check if the database can be opened without the error appearing.
1) There is not a valid license available:
This can be confirmed by having the database open in 4D or 4D Server.
In 4D go to the Menu Bar at the top > 'Run' > 'Start Web Server'.
In 4D Server go to the HTTP Server Tab and look for the Start HTTP Server button.
If any of these are greyed out, there is not a valid license available allowing the Web Server to be ran.
2) The port is not available:
If the license is avaiable, then there is possibly an issue with the Port. Try changing the port to an unused port. There are methods to check if a port is being used or block.
Tech Tip on how to check Ports:
http://kb.4d.com/assetid=76029