0

When I try to view my site in localhost I get this error:

unexpected '(' in c:/wamp64/bin/apache/apache2.4.46/bin/php.ini on line 1964
in C:\wamp64\scripts\refresh.php on line 1034

Here's the lines around that code in php.ini - line 1964 is the beginning of set_error_handler()

xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="c:/wamp64/tmp"
xdebug.show_local_vars=0

set_error_handler(function($errno, $errstr) {
    return strpos($errstr, 'mcrypt_') === 0;
}, E_DEPRECATED);

I can't see anything wrong in either file.

I thought it might have been the short_open_tag issue, but I tried setting it to short_open_tag = On but it made no difference.

The other weird thing is that in the browser's url box, if I add a file after 'localhost' - it downloads rather than executing the file eg

localhost/privacy-policy.php downloads privacy-policy.php rather than displaying it

Any idea what else causes this?

Thank you.

Shaun
  • 2,043
  • 3
  • 27
  • 36
  • 3
    on line 1964 of c:/wamp64/bin/apache/apache2.4.46/bin/php.ini is a `(` that should not be there... is what the error says. Maybe you should share the lines 1960 to 1070 from that file... without that we can't see whats wrong either. – Gert B. Oct 12 '21 at 10:15
  • 1
    nope. line 1964 of php.ini is a `(`. – Martin Zeitler Oct 12 '21 at 10:18
  • 1
    @MartinZeitler i was editing the comment... my mistake – Gert B. Oct 12 '21 at 10:18
  • 1
    `; in php.ini means comment line . Message does not count comment lines. So line 3 means 3rd line after top comments.` - [reference](https://stackoverflow.com/a/16119791/446594) – DarkBee Oct 12 '21 at 10:23
  • Thanks Gert - I've updated the question. But if DarkBee is right, then those line numbers will be off, and it'll be damned near impossible to figure out which line it's referring to – Shaun Oct 12 '21 at 11:21
  • 1
    Just use a tool like sublime which have multiline edit, dump the ini in there and delete all the lines starting with `;` ([sublime multiline edit](https://stackoverflow.com/questions/39556514/sublime-text-3-how-to-edit-multiple-lines)) – DarkBee Oct 12 '21 at 11:37
  • The other weird thing is that in the browser's url box, if I add a file after 'localhost' - it downloads rather than executing the file eg localhost/privacy-policy.php downloads privacy-policy.php rather than displaying it – Shaun Oct 12 '21 at 22:17

1 Answers1

0

The issue was that one of the devs had added an htaccess file that was related to the online test server - it was interfering with the local test server. Thanks for taking a look though guys.

Shaun
  • 2,043
  • 3
  • 27
  • 36