0

guys I am trying to see if lookup works I made a file in public called stocks.php wrote this simply to dump the values I seem to be getting this Fatal error: Call to undefined function lookup() in /home/jharvard/vhosts/pset7/public/stocks.php on line 2

Why does the error say undefined function lookup()? isnt it defined in functions.php? I dont understand what the error is trying to tell me

<?php
//config
require("../includes/config.php");
$stock = lookup("GOOG");
dump($stock);
?>

1 Answer 1

1

Have you checked that you have the right permissions on those files?

In ~/vhosts/pset7/includes, type ls -l, and confirm

  • config.php and

  • functions.php are both

    - rw- --- --- .

If not, try running chmod 600 *.php.

7
  • these are my current permissions they dont help :( I am going here if it helps pset7/stocks.php Commented Sep 24, 2015 at 8:27
  • imgur.com/plOwvM2 Commented Sep 24, 2015 at 8:28
  • Try calling apologize() and comment out lookup. If that works, maybe your functions file has corrupted?
    – Sam Gerber
    Commented Sep 24, 2015 at 9:20
  • Hmm...my functions.php is the same size and has the same update date as yours...does aplogize() work?
    – Sam Gerber
    Commented Sep 24, 2015 at 9:22
  • ok this helps. I tried deleting everything and only having apologize. Commented Sep 24, 2015 at 9:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .