I am using WAMP5 Version 1.7.2, which includes :
1. PHP Version 5.X
2. MySQL Version 5.X
3. Apache Version 2.X
But it does not recognize DB.php file, I dont why...I get the following error
failed to open stream: No such file or directory in F:\wamp\www\XXX
any idea please...
Is this your own DB.php file, or are you trying to use the DB PEAR extension?
If it is the PEAR DB file, you need to install PEAR then download and install the DB package, but in saying that, the DB package for PEAR is now out dated and is reccommended to you use the MDB2 PEAR package. Just some available info for you:)
Thanks for replying,
Where I can find PEAR package? and how do I install that? where I should Install that?
Open up your start menu and click on run, type in cmd then hit enter. Now I am not sure how your wamp setup directory is but I will base this on my installation, if the directory is different you will need to change it.
In the cmd (command console) type this at the prompt:
then hit enter. If all goes well it will ask you if you want to install a remote or local copy, type in 'local' without the quotes then hit enter, it will then show a directory setup for the files and give you an option to change them. Just leave them as they and just hit enter, don't type anything. This should install PEAR automically to the required files. You then need to include this in your php.ini file. Your php.ini file is stored at c:\wamp\bin\php\php5.2.5. Open this file click edit, then find and type in include_path. The line you are looking is:
#For win32 only
you need to change this to:
This should conclude the PEAR installation.
P.S If you can't access your cmd through the run command, you can find it here, click start, then All Programs, then Accessories, then cmd.
Once you have done this and succeeded, Restart you apache then write back, We can then tell you how to install the DB package for PEAR:)
I don't bin folder in my wamp folder, so I have go-pear.bat in the following folder:
so I installed the go-pear.bat and I have a folder named PEAR, also I changed the path in both php.ini, one php.ini in F:\wamp\php and one php.ini in F:\wamp\Apache2\bin, but still I have the same error.
can tell me what to do next?????????????
You now need to install the DB Package for PEAR and point the files that are calling on the DB.php file to point to that folders direction.
P.S There is no need to change the php.ini file inside of the bin folder of apache. Just the one in the PHP directory:)
You will have to download the DB package and install it manually as it is not reccommended anymore. But you can update this to MDB2 when you feel your ready, for now, we will just concentrate on getting it to work. You can get this package from here PEAR DB Package
You will need a program that can extract .tgz files like winace, you can download winace. Just type in into google. Once you have extracted these files, browse through them until you see the DB.php and three Other directorys. One of those Directorys is called DB. Copy this directory and the DB.php file directly into your PEAR folder and the DB Package is now installed. Now just point the files that are calling it to the PEAR folder which will look like this:
and it should work:)
P.S Also note, that you should have a database to connect to and those settings should be configured somewhere in one of your scripts. You will need to modify these settings.
HostName: localhost // This is correct.
UserName: username // Set this to the username you used to access the database, the same as your mysql username, this will be 'root' if you have not created a new user.
PassWord: password // This is the password you use to access the database, the same as your mysql access password if you have not created another user.
DataBase: database name // The name of the database you want to connect to.
The DB.php file will not work, unless these settings are configured properly:)
Thanks a world Mr. richie513,
now after following the step by step your instructions, the problem solved successfully...
just about the setting the path:
include_path = ".;c:\wamp\php\includes;c:\wamp\php\PEAR"
= and "" forgotten
On the above link, it is stated:
$numberedString = "1234567890"; // 10 numbers from 1 to 0
$fivePos = strpos($numberedString, "5");
echo "The position of 5 ...
I do not understand this atall.
"PHP Magic constants
PHP provides a large number of predefined constants to any script which it runs.
There are ...
What does it really mean by "escaping" in a string ?
The escape-sequence replacements are −
\n is replaced by the newline character
\r is replaced by ...