Problem solved. It was PHP safe mode being turned on. There is a lot of info if you search the installation forum on that.
Hope this saves someone the 10 days of hell this caused me.
Thanks to all who responded.
C.
Backup and restore
Unique folder ownership problem with "moodledata" folder
This discussion has been locked so you can no longer reply to it.