-4

I'm developing a web based program and i have several cron jobs for this on my cPanel. Every one of them works perfectly from cron and manually except one. I'm using Codeigniter. The PHP function works perfectly when i run it manually via browser. But when it runs from cron not all the parts of the function works.

I read almost every article about this problem but i still have it.

My cron command is like

59 23 * * * curl --silent http://www.domainname.com/some_controller/some_function

Emre Çay
  • 1
  • 1
  • You'll have to help people reproduce the problem by providing a [mcve] of, at least, the function that's not working. – Gino Mempin May 30 '19 at 00:43
  • @GinoMempin thanks for the reply. I didn't write the function because its working fine when i browse it. I thought that my cron entry was wrong or i need some setting for my cronjob. – Emre Çay Jun 01 '19 at 15:32

1 Answers1

0

I solved the problem. The problem is not the cron job but the code. When the function runs it logs the progress with the user who execute it. Thats why it runs perfectly manually. When cron do this there is no user so the code fails.

Emre Çay
  • 1
  • 1