You are not logged in.

#1 2012-05-23 08:17:59

diederick76
Member
Registered: 2010-02-14
Posts: 157

PHP: syntax error, unexpected '&' in /etc/php/php.ini on line 108

Hi all,

I have a peculiar problem. My http error log show these lines repeatedly:

PHP:  syntax error, unexpected '&' in /etc/php/php.ini on line 107
PHP:  syntax error, unexpected '&' in /etc/php/php.ini on line 108

My /etc/php/php.ini's lines 104 through 109 are:

104   ; error_reporting
105   ;   Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
106   ;   Development Value: E_ALL
107   ;   Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
108 
109   ; html_errors

So the &s on line 107 are to be expected, and line 108 is empty. Does anyone have any idea what's going on here?

Thanks !

Offline

#2 2012-05-23 11:47:14

XT
Member
Registered: 2012-05-21
Posts: 14

Re: PHP: syntax error, unexpected '&' in /etc/php/php.ini on line 108

As line 108 is empty, my first guess would be a chroot for your webserver / PHP interpreter. Is PHP really using the file you are looking at?

Offline

#3 2012-05-23 11:51:42

diederick76
Member
Registered: 2010-02-14
Posts: 157

Re: PHP: syntax error, unexpected '&' in /etc/php/php.ini on line 108

It appears so. From my phpinfo():

Configuration File (php.ini) Path 	/etc/php
Loaded Configuration File 	/etc/php/php.ini
Scan this dir for additional .ini files 	/etc/php/conf.d
Additional .ini files parsed 	(none) 

/etc/php/conf.d contains no files.

Offline

#4 2012-05-23 12:57:36

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: PHP: syntax error, unexpected '&' in /etc/php/php.ini on line 108

The semi-colon indicates a comment, it seems a bit strange PHP would be annoyed by random formatting in comments... After all, that's why they're comments.

Are you sure there's nothing wrong higher up?


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#5 2012-05-23 13:02:52

diederick76
Member
Registered: 2010-02-14
Posts: 157

Re: PHP: syntax error, unexpected '&' in /etc/php/php.ini on line 108

I agree there must be something going on that has little to do with the file mentioned. Even when I remove all the &s from line 107, or insert a few blank lines before line 107 (moving the supposedly wrong lines down) it still complains about &s in lines 107 and 108.

But where do I look?

Offline

#6 2012-05-23 13:14:51

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: PHP: syntax error, unexpected '&' in /etc/php/php.ini on line 108

Make sure you use an editor with syntax highlighting, and go up until you find the error. Look especially close at the lines you remember having edited before.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#7 2012-05-24 12:02:11

XT
Member
Registered: 2012-05-21
Posts: 14

Re: PHP: syntax error, unexpected '&' in /etc/php/php.ini on line 108

diederick76 wrote:

I agree there must be something going on that has little to do with the file mentioned. Even when I remove all the &s from line 107, or insert a few blank lines before line 107 (moving the supposedly wrong lines down) it still complains about &s in lines 107 and 108.

But where do I look?

I'd recommend checking your web server's config on wether a chroot is set or someting.
You could also try

sudo find / -name php.ini

This should list all php.ini's in your file system, including the one php is actually using.

Offline

#8 2012-05-27 22:09:05

clownfish
Member
Registered: 2006-09-04
Posts: 72

Re: PHP: syntax error, unexpected '&' in /etc/php/php.ini on line 108

Make a backup of /etc/php/php.ini and then empty the file, or delete at least everything after line 106. Then restart your http server. If the error still occours, then you're working definitely on the wrong php.ini wink

Offline

Board footer

Powered by FluxBB