Jump to content
Larry Ullman's Book Forums

What Exactly Is A Uri?


Recommended Posts

Larry,

 

I hate to ask such a stupid (and probably obvious to most) question, but what exactly is a URI?

 

In your book, you define it as "/path/to/Web/parent/directory/", however that doesn`t tell me much! My domain name is

"www.tuesdaygirl.com", but how in the name of god do you point to the parent folder of a root web directory that a domain

name is pointing to? Perhaps I sound like a smart ass, but should it be "../" Well, since I have no idea how to set that up, I

decided to just point the BASE_URI to the web directory itself. In this case is I`m guessing that the URI should be:

"http://www.tuesdaygirl.com/", however what is the URI doing that the URL can`t do. It all seems like a big unnecessary

mess really!

 

Just to clarify, I have decided to post the constants for the URL and location of all files on my site:

 

define ('BASE_URI', 'http://www.tuesdaygirl.com/');
define ('BASE_URL', 'www.tuesdaygirl.com/ecommerce/');
define ('PDFS_DIR', BASE_URI . 'pdfs/'); // Added in Chapter 5.
define ('MYSQL', BASE_URI . 'mysqli_ecommerce_connect.php');

 

Is this correct? I used to get a "file not found" error for the mysqli_ecommerce_connect.php file before I wrestled with the URI

for 30 minutes. Now that it seems to be working, I just get a blank page when I go to www.tuesdaygirl.com/ecommerce/index.php

 

Also, how on earth do I point to the mysqli_ecommerce_connect.php file if it`s outside the web directory? I tried this, but the URI is

getting in the way! When I change the BASE_URI for the mysql file to "../mysqli_ecommerce_connect.php" I get an error which shows

that path it is trying to resolve as: "http://www.tuesdaygirl.com/ecommerce/../mysqli_ecommerce_connect.php"

 

Now believe me Larry, I`m not trying to give you a hard time (I always tell Hartlysan that you are the "web programming god"),

but a little more explanation of this in the future - and perhaps some real world examples (i.e. "www.example.com/foldername/")

- would be great! I generally follow all your code (both easy and advanced), but something like this shouldn`t take a degree in rocket

science, nor 1000 headaches, to get your head around!

 

Matt

Link to comment
Share on other sites

URI is the file path to the webroot.

 

In your URI above you have www.domainname.com that is the URL to the webroot.

 

URI is the file path so in linux based servers that use cpanel the base_uri should be something like

 

/home/username/public_html

 

some use

 

/home/username/www

 

The public_html folder is a REAL folder that contains all the files where the www version is what is called a symbolic link which is a shortcut of sorts that points to the public_html folder. Technically there is no www folder but in reality it doesn't matter you can use either one but I personally choose to use public_html since that is the actual folder itself.

 

 

All you are doing with defining the URL, BASE_URI, MYSQL is creating shortcuts that point to those locations within your code. Instead of having to replace each instance in all your files for your site you just use one of those "shortcuts" instead of writing out those locations anytime you need to point to that location in your code. This way if something changes, you move to a new host, you change a folder name or whatever maybe the case then you are just changing ONE line which then automatically updates through out your entire site.

 

Though if you don't use those "links" in your code then you have to manually change each line to match what it should be. Just saves time and easier to maintain your code.

  • Upvote 1
Link to comment
Share on other sites

If you don't know what the URI is for your site and don't know where to look, create a new php file and put only the following into it.

 

<?php

phpinfo();

?>

 

 

Save the file, name it something like info.php. Then use an FTP software and upload that file to the webroot of your site. Then open that file in your browser. It will give you a listing of your PHP setup for your domain and the server. It will give you much detail on modules installed into php, folder paths and all sorts of information. It will also tell you the names of variables and what they contain such as the URI of your site, file path to the file you just opened in your browser and a lot of extra information about settings of php.

 

IF your php installation running on your webhost is setup in such a way that file may also tell you information about Apache itself and where all the behind the scenes configuration files are located. Most hosts don't have php running in a way that shows that information but some do, if you are lucky to have such a host then you will be presented with information that is really interesting but which you more than likely will never have access to actually do anything with or be able to change. Though it is interesting to look and see what settings are set or not.

 

For safety once you have looked at this information you should either delete this file off your site OR change the chmod settings of the file to 600 instead of 644 OR place it into a new subfolder which you can disable once you are done looking at it. It maybe interesting for you to create this file but add user login access to it so those that do not have the password never see the output. I did this on one of these files for one of my sites, but I kept forgetting the password so I just deleted the file and reupload it whenever I need access to this information then delete it when I am done.

 

If you leave it on your site, sooner or later someone may discover it and use the information to hack your site, send bulk spam email from your site or turn your site into a bot that hacks visitors computers and turns them into bots for sending spam emails or worse. That is why I never leave my phpinfo files on my sites or without being locked down so it is not available to be used when I am not using it myself.

  • Upvote 1
Link to comment
Share on other sites

Also, how on earth do I point to the mysqli_ecommerce_connect.php file if it`s outside the web directory?

 

This particular book is not meant for beginners, this is more of an intermediate book that assumes you have basic knowledge of PHP before coming to it. You may find one of Larry's other books most helpful in learning more of the basics, some have turned to the new PHP 6 and MySQL 5 book to help them learn what they haven't picked up yet. I myself have quite a few of the PHP 5 and MySQL 5 books from various authors and every one has different things in it or show more examples than others. Also google is really awesome for finding examples others have put online to learn from and go into more detail examples from things found on php.net.

 

The URI is the file path structure through your hosting account. /home/username/public_html/ type of format.

IF your php file is located in the web root doing something like:

 

../

 

will cause a look at the folder one level up from the current file path. So if your php file that you are calling from is in the webroot and your config file is in your user folder like so:

 

/home/username/public_html/myhappyfile.php

calls to

/home/username/myconfigfile.php

THEN

include('../myconfigfile.php');

placed within myhappyfile.php will correctly link to your config file.

 

 

BUT if your config folder is located in a subfolder off your username folder then ../ will not find it.

 

Instead what I do is create a new Definition and point to the file I need OR make sure I link properly using

 

../myconfig.php

 

method, so that it doesn't matter what site I put my files into as long as I put all the files in the correct places my script will find them.

 

IF you are going to hardcode the exact path /home/username/config.php THEN I would create a new definition and use that in my files this way I only have to update in one line instead of all over my files where I use that path. The username will be different in each site you put your files in and I don't know of a variable in php that holds that information like you would find in windows that would auto inject that information into your scripts.

 

 

Edit:

 

If you are using a subfolder located off of the folder one level up from the current file then do the following:

 

 

current file:

myfile.php

 

which is located:

 

/home/username/public_html

 

and links to config.php which is located:

 

/home/username/subfolder1/config.php

 

 

Use the following:

 

include('../subfolder1/config.php');

 

 

That goes one level up and then one level down into a specific folder pointing to a specific file within that folder.

  • Upvote 1
Link to comment
Share on other sites

Terry,

 

Thank you very much for your detailed response! It has really cleared all of this up for me!

 

This particular book is not meant for beginners, this is more of an intermediate book that assumes you have basic knowledge of PHP before coming to it. You may find one of Larry's other books most helpful in learning more of the basics, some have turned to the new PHP 6 and MySQL 5 book to help them learn what they haven't picked up yet. I myself have quite a few of the PHP 5 and MySQL 5 books from various authors and every one has different things in it or show more examples than others. Also google is really awesome for finding examples others have put online to learn from and go into more detail examples from things found on php.net.

 

That`s why I said that "I hate to ask such a stupid question"! I do own "PHP 6 and MySQL 5" and have gone through it at least twice

over the past 3 years! In fact, it is pretty tattered and pages are starting to fall out from having carried it around so much! It`s very

straight forward and I pretty much have it down! I also own, "PHP 5 Advanced", but I use it more as a reference and have only skimmed

through certain topics. That`s the problem here: Larry has never, in any of these books, clearly defined what exactly a URI is! He

spends one sentence on URIs on page 540 of "PHP5 Advanced" as part of another topic, but that`s it!

 

I even spoke with HartleySan, who is an "Advanced Member" in this forum, and even he didn`t know what a URI was when he bought

"Effortless E-Commerce". He had to spend hours on Google trying to figure out what it was! And that leads to another problem - a URI

is more of an umbrella term, and it has different meanings depending on what site you go to, which further adds to the confusion!

 

I think one problem is that when it comes to PHP I start to rely on Larry as a source for all information. And usually this is fine because

things flow from one book to the next and he builds on older examples/ideas. However, this one came out of nowhere and it was just

assumed that we knew what a URI was! I just think he needs to cover this a little more in the next edition of "Effortless E-Commerce".

A quick and thorough description, like the one you gave me, would be perfect!

 

Thanks again,

 

Matt

Link to comment
Share on other sites

I learn by context. I took the code provided in the book and derived that BASE_URI is the file path to the web root based on the example code and the description provided when referencing that bit of code in the book. If you notice BASE_URI is a definition, defined by larry. You could rename that to WEB_ROOT to make it more descriptive so at a glance you know what it is.

 

Wikipedia defines URI as:

http://en.wikipedia.org/wiki/Uniform_Resource_Identifier

a Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet...

 

One can classify URIs as locators (URLs), or as names (URNs), or as both. A Uniform Resource Name (URN) functions like a person's name, while a Uniform Resource Locator (URL) resembles that person's street address. In other words: the URN defines an item's identity, while the URL provides a method for finding it...

 

In context of PHP code I have ever seen, URI is file path location to the file or folder while URL is the website address to the same, the www.somesite.com address OR ip address to the site. Though you can use the www.somesite.com as the URI it does make it confusing and isn't really good to interchangeably use URI as URL as you will get confused to what each is.

 

I say URI is universal resource indicator, wikipedia and others say it is uniform resource identifier... whatever, as long as I know what it does.

 

So basically URI is the file path, the operating systems way of knowing where things are whether it is unix/linux or windows. URL is the internet address to the same location. They both work differently but point to the same places.

 

Now, in my mind there has to be a distinction because there are certain situations where URL can't be used like when you are accessing resources, files or folders outside of the web accessible folders. URL will NEVER get to those resources and you have to be able to get there so a different method needs to be used, in those cases URI is vital and why in my mind the distinction between URI and URL.

 

Though in your code you may want to change define names to WEB_ROOT vs BASE_URI, but the reason you should know what they are is so when you communicate with someone else there is a common reference, even if the other person doesn't know what URI is, if you know what it is and can explain what you are talking about then you both can use the term URI to reference, instead of saying web root, or file path because URI by itself isn't really web root it is file path, base uri is web root though I have NEVER used that term.

 

I dunno, I just learn by context and use of code, it can be confusing when you see multiple examples and different people use this in different ways but now that you understand the purpose behind URI and URL you will use them correctly.

 

Anyway that is my thoughts on that, right or wrong, it works for me.

  • Upvote 1
Link to comment
Share on other sites

I have the same lack of understanding of the URI and this thread is very helpful. Thanks.

I think I now understand how to set it up on a hosted server, where you have a file structure like: /Users/Username/Sites/ex2/. This is how Larry's example is laid out in the downloadable code.

How about for those working on a local host with Xampp for example? I am just unsure how far back we have to go to define the base URI of the site.

I did not find any specific BASE_URI answer in phpinfo().

The "Document Root" is C:/xampp/htdocs

So would the BASE_URI be something like C:/xampp/htdocs/ex2/ ?

Or would it be /xampp/htdocs/ex2/ ?

 

The REQUEST_URI when I ran php_info was /ex2/php_info.php

So could the BASE_URI for those of us using a local host just be /ex2/ ?

 

Or would you start with /Users/ when working on your local host as well?

 

Thanks again for the helpful thread.....

Link to comment
Share on other sites

Did you specifically setup a site within XAMP that points to that ex2 folder? So if you associated something like http://www.ex2.lcl then it opens to the ex2 folder? OR are you just using the default settings and haven't customized it yet?

 

I did not find any specific BASE_URI answer in phpinfo().

The "Document Root" is C:/xampp/htdocs

 

I was looking at this today actually in a tutorial I found in another book.

 

EDIT:

 

Document Root is considered to be the BASE_URI. In other words it is the starting folder that is accessible to the web browsers and any sub folder underneath it. the folder the current file is located in.

There are several definitions that all mean the same thing, web root, document root, base_uri are the same.

 

URI, some consider to be path to webroot but if you look at the context URI is usually used in it is just the file path to a location a folder or file. It does NOT have to be to a web accessible folder or file though. I noticed also that URI is interchangeably used when referencing web URL paths as well, just to add to the confusion I think. You have to pay attention to context of what the person using it is trying to explain, they may have the definition wrong OR we do... LOL

 

 

 

So would the BASE_URI be something like C:/xampp/htdocs/ex2/ ?

Or would it be /xampp/htdocs/ex2/ ?

 

EDIT:

 

It is whatever phpinfo told you the document root is. EXACTLY typed as it says it is.

 

The BASE_URI is the parent folder, the starting folder that is web accessible. When you type the address into your web browser that first folder that gets accessed is your BASE_URI.

 

http://www.ex2.lcl if you had that setup in your virtual hosts file then whatever folder that is pointing to is the BASE_URI for that site.

 

IF in your testing environment you are using the default settings with no virtual hosts setup and you have to type:

 

 

Then technically whatever folder localhost itself points to is the BASE_URI but in context of the site you are working in then \ex2 is your base_uri or web root.

BUT you can't just type \ex2 and that is it.. you have to type the actual file path to that folder so if it is in C:\htdocs\ex2 then you have to put that whole thing into the BASE_URI definition.

 

 

The REQUEST_URI when I ran php_info was /ex2/php_info.php

So could the BASE_URI for those of us using a local host just be /ex2/ ?

 

The REQUEST_URI is different from URI and document root and files.

 

Without going to look up the exact definition for you I will just explain my observation of it.

REQUEST_URI is everything "AFTER" the www.yoursite.com in the URL.

 

This could be information you are passing such as variables, session information, folder or page.

It comes in handy when you need to know everything that is passed to your files without knowing exactly what is there and you already know the domain name.

 

--------------

 

I do not use XAMP or any specific premade installer that puts apache, mysql, php etc... on your windows computer and sets things up for you.

I used to use Vertrigo which is a different flavor of these type of software, the problem I had was when I needed a specific install of apache or php or mysql you are kind of stuck.

Now I manually go to each applications website and download then install the version closest to what I need and then I manually configure the config files how I need. I do not see any difference,

between doing it manually and using one of the premade softwares like XAMP except manually it gets setup how I want it.

 

I also created a little utility that I use to start and stop Apache and MySQL, restart them and tell me if they are currently running or not.

 

In Apache's httpd.conf file there is a section at the bottom that either links to a seperate file OR is contained within httpd.conf that allows you to setup virtual hosts.

This is what you use to setup something like http://www.ex1.lcl and point that to say /ex1 folder off of your web root but the brilliance of these virtual hosts is they do not have to be inside the predefined web root XAMP or whatever sets up for you. I have mine all setup on a seperate hard drive from my operating system drive, this folder could also be on a flash usb stick if you wanted. Of course you have to have the flash stick connected to a working USB connection.

 

The reason I said all that is when you setup a new virtual host that points to a specific folder, then THAT folder becomes the new web root for that site. I have 30 or 40 seperate web roots contained within my virtual hosts file for my installation of apache. Just typing the specific local site into my web browser takes me to that specific site.

 

The new version of Apache the virtual hosts are located in a seperate file linked to from the httpd.conf file, they all used to be inside that one file. I think the particular premade installation software I used the creators consolidated into one file, but in the standalone apache you can download off apache's site all these things are in seperate files located in etc subfolder. Took me awhile to figure it out but I got it all working.

  • Upvote 1
Link to comment
Share on other sites

This is how you setup a new virtual host that then becomes a stand alone web root. This folder you link to can be anywhere on any drive accessible to the computer you are using.

 

I used to use just plain ex1 vs ex1.com or www.ex1.com the problem I ran into was testing my scripts, I really needed a full domain path so I now use .lcl as the extension which of course stands for local.

 

Step 1:

 

<VirtualHost 127.0.0.1:80>
   ServerName ex1
   Redirect permanent "/" "http://www.ex1.lcl"
</VirtualHost>

 

The above redirect ex1 to www.ex1.lcl because I am lazy and don't want to type the full domain path I just want to type ex1 and it takes me to www.ex1.lcl

 

Step 2:

 

<VirtualHost 127.0.0.1:80>
   ServerAdmin someemail@localhost.lcl
   DocumentRoot D:\_intranet\ex1
   ServerName www.ex1.lcl
   ErrorLog ex1-error_log.txt
   CustomLog ex1-access_log common
</VirtualHost>

 

Now this is the actual virtual host itself that points to hard disk D: in subfolder /_intranet that contains a folder called /ex1

 

http://www.ex1.lcl will now point to the /ex1 folder and that folder is NOW a web root for that URL.

 

You must put those two code block together in the same file, whether that is in the virtual hosts section of httpd.conf or it is the virtual hosts file depends on your apache setup, I can't know this but it will be one or the other and is found out but looking in the httpd.conf file towards the bottom of the file there will either be a virtual hosts section, that is commented out OR a link to a virtual hosts file will be found.

 

 

Step 3:

-----------

 

Find and open your hosts file, found at C:\windows\system32\drivers\etc\hosts This file does NOT have an extension and should never have one.

Open this file in notepad and type the following somewhere in the file, it does not matter where you place it as long as it is not commented out.

 

127.0.0.1 ex1

127.0.0.1 ex1.lcl

127.0.0.1 www.ex1.lcl

 

Then save the file. You do NOT have to restart windows OR apache after you get done editing this file. You may be presented with a warning message, ignore it and save over the existing file.

Notepad may not allow this. I personally use PsPad which is a free editor. If you have trouble saving over this file you can temporarily change the file permission by right clicking on the file and choosing properties then unselect read only. You operating system will not come to a crashing halt if this file is writeable, sort of a security risk but all this file does is allow you to redirect your internet enabled software from one site to another or to localhost which prevents access to a site or sites from your computer only.

 

Once you have made the changes to the httpd.conf or auxilary file you will need to restart apache.

 

Done setting up a virtual host.

 

For every conceivable URL you want to access a specific local virtual host you will need to add an entry to both the hosts file AND the virtual hosts section of apache's config file.

 

You can actually have ex1.lcl redirect to www.ex1.lcl or vice versa BUT bewarned you will never be able to access the URL you are redirecting, this causes trouble if you are testing a www vs non www version of your scripts because you could restrict yourself out of one or the other of those depending what you put in the virtual hosts.

 

A lot of people don't know how to setup local testing environments so this should be helpful. Other things you can do also is make htaccess files work, setup php error files to show up in the folder that causes the error instead of hidden away in php's installation folders somewhere, if you have error tracking turned on. I renamed my errors file to errors_log.txt so I can double click it and it opens up in my editor. There is a lot of things you can do actually and if you have root access to your sites, you can duplicate your testing environment settings on your hosting account OR vice versa.

  • Upvote 1
Link to comment
Share on other sites

I think I am wrong about DOCUMENT_ROOT.

 

Here is copy/paste from one of my phpinfo files on my testing environment.

 

SCRIPT_FILENAME D:/_intranet/home/stats/php_info/index.php

 

DOCUMENT_ROOT D:/_intranet/home/stats/php_info

 

I first thought document root was the folder you first logged into from FTP which is

 

/home/username

 

for most hosts out there or with reseller account anyway where you can have each site under it's own space.

But that isn't correct.

 

I then thought it was the web root.. BUT, looking at my phpinfo output it appears that DOCUMENT_ROOT is the actual

folder that the current file is located. The definition at PHP.net says it is the folder the current file is running under.

So if you have 30 files in 10 different folders then you have 10 separate document roots.

 

Joy. Definitions.. I usually just point and say I want it to do that, make it do that. LOL

  • Upvote 1
Link to comment
Share on other sites

Did you specifically setup a site within XAMP that points to that ex2 folder? So if you associated something like http://www.ex2.lcl then it opens to the ex2 folder? OR are you just using the default settings and haven't customized it yet?

 

 

 

I was looking at this today actually in a tutorial I found in another book.

 

EDIT:

 

Document Root is considered to be the BASE_URI. In other words it is the starting folder that is accessible to the web browsers and any sub folder underneath it. the folder the current file is located in.

There are several definitions that all mean the same thing, web root, document root, base_uri are the same.

 

URI, some consider to be path to webroot but if you look at the context URI is usually used in it is just the file path to a location a folder or file. It does NOT have to be to a web accessible folder or file though. I noticed also that URI is interchangeably used when referencing web URL paths as well, just to add to the confusion I think. You have to pay attention to context of what the person using it is trying to explain, they may have the definition wrong OR we do... LOL

 

 

 

 

 

EDIT:

 

It is whatever phpinfo told you the document root is. EXACTLY typed as it says it is.

 

The BASE_URI is the parent folder, the starting folder that is web accessible. When you type the address into your web browser that first folder that gets accessed is your BASE_URI.

 

http://www.ex2.lcl if you had that setup in your virtual hosts file then whatever folder that is pointing to is the BASE_URI for that site.

 

IF in your testing environment you are using the default settings with no virtual hosts setup and you have to type:

 

 

 

Then technically whatever folder localhost itself points to is the BASE_URI but in context of the site you are working in then \ex2 is your base_uri or web root.

BUT you can't just type \ex2 and that is it.. you have to type the actual file path to that folder so if it is in C:\htdocs\ex2 then you have to put that whole thing into the BASE_URI definition.

 

 

 

 

The REQUEST_URI is different from URI and document root and files.

 

Without going to look up the exact definition for you I will just explain my observation of it.

REQUEST_URI is everything "AFTER" the www.yoursite.com in the URL.

 

This could be information you are passing such as variables, session information, folder or page.

It comes in handy when you need to know everything that is passed to your files without knowing exactly what is there and you already know the domain name.

 

--------------

 

I do not use XAMP or any specific premade installer that puts apache, mysql, php etc... on your windows computer and sets things up for you.

I used to use Vertrigo which is a different flavor of these type of software, the problem I had was when I needed a specific install of apache or php or mysql you are kind of stuck.

Now I manually go to each applications website and download then install the version closest to what I need and then I manually configure the config files how I need. I do not see any difference,

between doing it manually and using one of the premade softwares like XAMP except manually it gets setup how I want it.

 

I also created a little utility that I use to start and stop Apache and MySQL, restart them and tell me if they are currently running or not.

 

In Apache's httpd.conf file there is a section at the bottom that either links to a seperate file OR is contained within httpd.conf that allows you to setup virtual hosts.

This is what you use to setup something like http://www.ex1.lcl and point that to say /ex1 folder off of your web root but the brilliance of these virtual hosts is they do not have to be inside the predefined web root XAMP or whatever sets up for you. I have mine all setup on a seperate hard drive from my operating system drive, this folder could also be on a flash usb stick if you wanted. Of course you have to have the flash stick connected to a working USB connection.

 

The reason I said all that is when you setup a new virtual host that points to a specific folder, then THAT folder becomes the new web root for that site. I have 30 or 40 seperate web roots contained within my virtual hosts file for my installation of apache. Just typing the specific local site into my web browser takes me to that specific site.

 

The new version of Apache the virtual hosts are located in a seperate file linked to from the httpd.conf file, they all used to be inside that one file. I think the particular premade installation software I used the creators consolidated into one file, but in the standalone apache you can download off apache's site all these things are in seperate files located in etc subfolder. Took me awhile to figure it out but I got it all working.

 

Ok, Thanks very much for the thorough explanation Terry...

So, for an Xampp instalation with default settings, I believe that my BASE_URI for this excercise is: C:\xampp\htdocs\ex2\

Is there a practical way to test and confirm that the BASE_URI is correct?

I suppose that if the application has access to the database, then the BASE_URI must be right, since the path to MYSQL is defined as: BASE_URI . 'mysqli.inc.php'

Link to comment
Share on other sites

xcrider2, I would set the base URI to C:\xampp\htdocs\, but you get the idea. If you have the base URI set up like that, you can better simulate the structure Larry recommends in the book, which is putting the MySQLI connect file outside of the Web root directory, etc. Actually, you might be able to set the base URI even to just C:\xampp\, but I am not sure if localhost can access files outside of the htdocs folder by default. Well, regardless, I think you have the right idea. It is tricky, and I ended up having to play around with it a bit myself until I figured it out in Windows using XAMPP as well.

  • Upvote 1
Link to comment
Share on other sites

xcrider2, I would set the base URI to C:\xampp\htdocs\, but you get the idea. If you have the base URI set up like that, you can better simulate the structure Larry recommends in the book, which is putting the MySQLI connect file outside of the Web root directory, etc. Actually, you might be able to set the base URI even to just C:\xampp\, but I am not sure if localhost can access files outside of the htdocs folder by default. Well, regardless, I think you have the right idea. It is tricky, and I ended up having to play around with it a bit myself until I figured it out in Windows using XAMPP as well.

 

Thanks very much HartleySan,

Yes, this is tricky, but your suggestion works perfectly.

I did notice that I had to put an extra \ in there because just one winds up escaping the single quote on the end.

So, I settled on 'C:\xampp\htdocs\\'

 

Hopefully, this thread will help others who come straight over from Larry's PHP6 And MySQL5 Quick Pro Guide with their handy Xampp installation. To these folks, I also recommend that you use the mysql Client from the command line interface, rather than phpMyAdmin, to set up the stored procedures. This was another tricky part for me, since phpMyAdmin doesn't seem to work consistently with stored procedures.

Link to comment
Share on other sites

 Share

×
×
  • Create New...