Hello i have formatted my pc with Windows 7 and installed wamp server. My local project doesnt work.
I am familiar with the difference between mysql and mysqli? Do i need to install a most recent version of Mysql than the one provided by Wamp Server?

Dani AI

Generated

Brief summary and likely causes: after a fresh Windows/WAMP install the usual culprits are a mismatch between the PHP build that Apache is running and the PHP build being edited, missing runtime dependencies, or extensions that fail to load because their dependent DLLs are not found. is right about staying current, and 's pointer to the PHP config is important. If the config has become confusing, 's suggestion to back up data and reinstall WAMP is a sensible last resort.

Quick diagnostic checklist (minimal, reproducible tests). Create a short PHP file that reports which php.ini is active and attempts a direct DB connection. The output will clearly show whether Apache is using the PHP install that was edited, and whether a connection error is reported:

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
echo "Loaded php.ini: " . php_ini_loaded_file() . "\n";
echo "PHP version: " . phpversion() . "\n";
$mysqli = new mysqli('localhost', 'dbuser', 'dbpass', 'dbname');
if ($mysqli->connect_error) {
  echo "DB connection error: " . $mysqli->connect_error;
} else {
  echo "DB connection OK\n";
}

How to interpret and act on results: if the script shows a different php.ini than the one edited, stop editing the wrong file and use the one reported. If the DB test fails but php shows the DB extension present, check that the extension DLLs physically exist in the extensions folder and that any auxiliary DLLs (Visual C++ runtime, ICU libraries, etc.) required by those extensions are installed or on PATH. Do not copy random DLLs between folders; install the correct VC redistributable that matches the PHP/Apache build (thread-safe vs non-thread-safe, 32/64-bit). Use WAMP's version switcher or reinstall a matched WAMP bundle if the build mix is broken.

Specific note about the login page vs index page: index rendering database rows while login fails usually means the login code uses a different connection path, different credentials, or sessions are not being saved. Confirm the login script is not suppressing errors, verify credentials and privileges, ensure session storage is writable, and retest with full error reporting enabled. If configuration becomes tangled, back up sites and databases, then perform a clean WAMP reinstall and restore the backups.

Recommended Answers

All 19 Replies

You should always make a habit of keeping up with newer versions, mainly because these versions are released for a reasib (security patches, bugs etc.)

I think PHP v5.3+ should cover it, but we are currently on v5.6, so you really should've upgraded a long time ago. MySQLi is a component of PHP, not the MySQL database engine, so it shouldn't matter which version you have. Again, I do reccomend v5.6 ish for efficiency/security reasons.

if you already have php installed you most likely just need to enable mysql in your php.ini file

Personally I would use XAMPP, as the binaries are that much more complicated to get sorted. As well as building and actually installing PHP, getting it to communicate with Apache and MySQL can be an absolute nightmare.

But as correctly says, do check your ini file first. These will be the settings to look for.

How do i enable php.ini?

The php.ini is just the PHP config file, and will definitely be present in all versions of PHP. In your root PHP directory (where all of the PHP system/core files are stored - i.e. C:\wamp\bin\php\ or C:\wamp\bin\php\php5.5.12 for example) there will be a file called php.ini, and in that massive file will be those settings.

Member Avatar for Member #120589

Updating PHP can be onerous as pointed out by mattster. I also use XAMPP, so not familiar with WAMP. But, installing PHP binary over a previous XAMPP install went spectacularly badly for me, so I just install new versions of XAMPP, as and when they're considered stable. I back up all data (php.ini, DB and sites first). Make sure that you check any installed libraries for upadtes too - some third party libraries you may have installed and using may be PHP version dependent.

The first thing to check in your php.ini file is this

;extension=php_mysqli.dll

if you have this line in your file uncomment it by removing the semicolon then restart your webserver this tells apache to load support for mysqli

commented: thanks +2

Mysqli extension is enabled without comment

extension=php_mysqli.dll

Member Avatar for Member #120589

WHat does phpinfo() give you?

[02-Jul-2015 13:34:41 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - The specified module could not be found.

I've done them all

; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.

extension=php_bz2.dll
extension=php_curl.dll
extension=php_com_dotnet.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
extension=php_shmop.dll

Just trying

just trying to move all icu* * * *.dll files:

from

C:\wamp\php

to

C:\xwamp\apache\bin

i have emptied the php error log, run my project and still getting

[02-Jul-2015 19:25:48 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_sybase_ct.dll' - The specified module could not be found.

in Unknown on line 0

Member Avatar for Member #120589

Is the php.ini file you have from a previous install?

Otherwise, can't see why a downloaded version would have these refs in php.ini uncommented if they weren't included in that release.

So is that file missing too?!

I have installed twice wamp in the first place. Plus there was a file on the php folder -the one that enables the extensions- called php.ini.development and opened it with notepad and now its called just php. Oh and another thing. Should i implement the php-5.6.10 version i downladed ?

I thing that something goes bad. My website has a login page. On the login page i can't retreive data from my database but on the index page the data are shown

Member Avatar for Member #120589

WTF? You're babbling.

php.ini.development is probably the file you want as it's a dev machine not a production server right?

Rename this to php.ini. Check there's not another file with this name already. If there is, check that that file isn't a hangover from a previous version.

If you keep running into problems and are spending days over this, maybe backup all your data (dbs and sites) and bite the bullet by deleting wamp and re-installing it. You can then copy over your saved dbs and sites.

With regard to your site - who knows? You give absolutely no info with regard to the content, file structure etc. This is starting to turn into a crystal ball gazing affair.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.