0

I am getting ini Parsing Error for the following ini file:

[photo]
price = 5.00

[shipping]
South Africa[value] = 50.00
South Africa[incremental] = 100

Pakistan[value] = 120.00
Pakistan[incremental] = 100

[discount]
min[quantity] = 50
min[value] = 5

max[quantity] = 150
max[value] = 10

[admin]
email = [email protected]
name = Admin
subject = Your order with xxx

The error comes on Line #5

It's quite weird. The same file works fine on my own machine but not on remote server

11
  • Would this be parsed into an array? Commented Mar 23, 2012 at 12:48
  • try quoting the floats, e.g. "50.00" instead of 50.00 Commented Mar 23, 2012 at 12:52
  • @Pekka yes it would be in Array form Commented Mar 23, 2012 at 14:06
  • @scibuff I give it a try, it works fine on my local machine Commented Mar 23, 2012 at 14:06
  • @scibuff putting it quotes did not make any difference. Same error Commented Mar 23, 2012 at 14:09

2 Answers 2

2

Any particular reason you can't do something like

$ini = array();

$ini["photo"]["price"] = 5.00;

$ini["shipping"]["South Africa"]["value"] = 50.00;
$ini["shipping"]["South Africa"]["incremental"] = 100;
Sign up to request clarification or add additional context in comments.

5 Comments

The Ini file will be used by someone who does not know programming, way easier than setting array in PHP file. The thing is, it works fine on my local machine but not remote. Is there any version issue or something else
The value like *South Africa[value] is creating problem, seems its not accepting nested values
Ok its confirmed, its not parsing nested values,I don't get why its like that.
what php version does the server have?
I rather made it as a PHP array like you mentioned. Thanks for your help
1

Upgrade to PHP5.3.1 to parse nested variables' values.

We've just confirmed the same issue on one of our LAMP servers, running PHP 5.2.17 as well.

The same code works on a different server running PHP5.3.8

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.