oustyle
oustyle

Reputation: 103

Undefined offset: 1 in C:\wamp\www\index.php

I edited the file "www / index.php" Wamp and duplicate each line MySql adapting with version of PostgreSQL

i have error Notice: Undefined offset: 1 in C:\wamp\www\index.php on line 64

my code is ( line 63 64 65 )

 preg_match('|PostgreSQLVersion = (.*)\n|',$wampConfFileContents,$result);
 $PostgreSQLVersion = str_replace('"','',$result[1]);
 preg_match('|wampserverVersion = (.*)\n|',$wampConfFileContents,$result);

Upvotes: -2

Views: 2100

Answers (1)

Pietro Coelho
Pietro Coelho

Reputation: 2072

I had a similar issue, but with the default installation.

This issue is because wamp has a problem trying to read the php version.

I noticed that in my wampmanager.conf file, it looked like this:

[php]
phpVersion ="5.6.19"
phpLastKnown = "7.0.4"
phpIniDir = "."
phpConfFile = "php.ini"
phpExeDir = "."

As you can see, in the "phpVersion" line there's no space between = and the version number, so wamp cannot read the version. You can fix this by applying the space:

[php]
phpVersion = "5.6.19"

Upvotes: 2

Related Questions