It can be an issue with user profile under which your PHP application is running. Please check article on server-side office automation of office products (it has common problems listed). To see if the problem is actually the account, I would try to change the account under Apache (PHP) is running to your account (or simply start Apache command line to see if it fixes the problem).
https://support.microsoft.com/en-us/help/257757/considerations-for-server-side-automation-of-office
https://theether.net/download/Microsoft/kb/288367.html
BTW, there are (paid) alternatives as well that can do calculations and run server-side.
CLICK HERE to find out more related problems solutions.