43 replies [Last post]
rmfred
rmfred's picture
Offline
Elder
Rock Springs, WY
Last seen: 3 years 38 weeks ago
Rock Springs, WY
Timezone: GMT-6
Joined: 2004-01-31
Posts: 1073
Points: 31

OK... decided it was time to venture into php versus asp.
I have a win98 laptop that I develop asp pages on... it runs PWS (personal web server) and all is good with that.
So.. I download windows installer for php and try it... can't get php to work.
So I attempt the manual install... still no luck

Now... I've tried so many different things I'm not sure I can see the forest for the trees... so I hope someone can steer me in the right direction.

I have a virtual directory called php and when I ran the windows php installer it created a c:\php directory with some sub-directories... I have the virtual directory pointing to that.

I can run html and asp files from the virtual directory but when I try a .php file I get a 404 file not found error even though the file is there. I'm guessing there must be something in an ini file that is incorrect? I did make a copy of the php.ini file that was created in c:\windows from the installer and tried putting that in the php directory but that didn't work either.

Any ideas as to what I should be looking for? Does a dll have to get registered or something?

thanks in advance for any clues you might be able to provide

Tags:
Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

You would need to register the main php dll , are you running this php as a module or as a CGI? module is better but I suppose on local host it's less important.

In my sapi folder of the win php files I have two default windows .reg files that I guess would need to be registered Smile
the sapi file (php4isapi.reg) contains this reg entry:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] 
".php"="[PUT PATH HERE]\\php4isapi.dll"


I would suggest that the [put path here] needs to be changed to your path to php4isapi.dll and then saved and imported into the registry.

Do you have to run PWS? a basic windows AMP package should run with ease and seems a lot less hassle than trying to install PHP/PWS

I installed PHPdev5 once and it was a breeze without any configuration issues even when for fun I tore it apart and manually updated the core PHP/ Apache files, I think I only had to drop php4isapi.dll and the phpapache.dll in the win32 folder and I was away and the nice thing being that it's not hooked into the system, to delete I just remove the directories and it's gone, but I don't let it run as a service only as a console.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

rmfred
rmfred's picture
Offline
Elder
Rock Springs, WY
Last seen: 3 years 38 weeks ago
Rock Springs, WY
Timezone: GMT-6
Joined: 2004-01-31
Posts: 1073
Points: 31

Way off topic... PHP and PWS

Hugo...
I started completely over with the manual install of php 5.1.2 and think I followed it to the letter? Obviously not, since it's still not working.

I don't have a sapi folder... and the install instructions say nothing about registering dll's save for this one php5activescript.dll which I did and then ran the test to see if it was working... which it is.

I'm attempting to run this as a cgi and made changes to
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parame
ters\Script Map] ".php"="C:\\php\\php.exe" (change to
C:\\php\\php-cgi.exe if you are using PHP 5) Now merge this
registery file into your system; you may do this by
double-clicking it.

At this point... the install instructions said I should have a fully working system. So I tried a php test file and got the following:
You have chosen to open test.php with is a php file... what should Firefox do with this file? Save or open to disk?

I then went back to the ini file and set the
cgi.force_redirect = 0 and when I try the test php page I don't get the previous error, but instead reverts back to http error 404.

Guess I don't NEED to run PWS, but I have a lot of ASP sites that I do dev work on and just feel reluctant to change something that works quite well for my needs.

I imagine I could try all of this on my desktop running xp pro, but I like all my dev work to be on the laptop.... six of one half dozen of the other I suppose.

Maybe I'm just too dumb and can't see the problem here... but I've never had this much trouble with ASP applications, configurations or database connection problems... so I would "think" I should be capable of setting up PHP?

Any brilliant ideas welcomed... I really didn't think it would be this difficult.

rmfred
rmfred's picture
Offline
Elder
Rock Springs, WY
Last seen: 3 years 38 weeks ago
Rock Springs, WY
Timezone: GMT-6
Joined: 2004-01-31
Posts: 1073
Points: 31

Way off topic... PHP and PWS

OK... think I finally got it? A totally "duh" moment.
I just realized that notepad was saving test.php as test.php.txt Smile
After fixing that and running the test.php page which has the following code:

<?php
phpinfo();
?>

I get a page with all sorts of config info pertaining to php version 5.1.2 so it appears that it is working?

So... NOW WHAT?
Where do I go from here?

thanks

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 37 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Way off topic... PHP and PWS

Now you can start putting together pages that have been done in ASP in PHP instead. Or you can download any number of free CMS, blog, forum, gallery or eCommerce modules and give them a go on your local machine (you'll also need MySQL installed for most of them).

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

Quote:
I just realized that notepad was saving test.php as test.php.txt

Smile not going to help matters, naughty notepad.

As Tyssen says now your next task for the evening is to download MySQL and install that and you can have even more fun, it may be a little harder getting MySQL to run than PHP though, but not much.

Now you have PHP running you can , at the simplest level, make use of basic php commands in your web pages saved as .php such as simple includes etc.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

rmfred
rmfred's picture
Offline
Elder
Rock Springs, WY
Last seen: 3 years 38 weeks ago
Rock Springs, WY
Timezone: GMT-6
Joined: 2004-01-31
Posts: 1073
Points: 31

Way off topic... PHP and PWS

Tyssen and Hugo...
Whoa... one thing at a time please Smile
I'm sure I can do the most basic of php stuff (like changing asp includes to php includes) but I need to tread slowly.

I've gotten my first test with connecting with an access db using php (I know I should be using mysql but small steps here... I'm an old dog and it's hard to teach me new tricks) to work... so that's a small start.

I'm halfway decent with asp... but php appears to be the way to go.

BTW... I just downloaded and installed XAMP... should I be using this installation for my php learning or stay with the php/pws ?

thanks for the previous comments

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

No go with Xamp it seems a nice install package I've recently set it up on a spare box, use it for your php work and it does have MySQL installed by default as well as PHPmyadmin to help out with MySQL but it's local dev work only as it is an insecure Apache setup.

Also go into php.ini in the Apache directory IIRC and turn register globals OFF don't start to learn PHP using register globals ON it's very insecure.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 37 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Way off topic... PHP and PWS

Hugo wrote:
No go with Xamp it seems a nice install package I've recently set it up on a spare box

Do you know if installing something like XAMP affects the running of pages under PWS/IIS?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

rmfred
rmfred's picture
Offline
Elder
Rock Springs, WY
Last seen: 3 years 38 weeks ago
Rock Springs, WY
Timezone: GMT-6
Joined: 2004-01-31
Posts: 1073
Points: 31

Way off topic... PHP and PWS

Tyssen wrote:
Hugo wrote:
No go with Xamp it seems a nice install package I've recently set it up on a spare box

Do you know if installing something like XAMP affects the running of pages under PWS/IIS?

As you know I'm just a raw newbie here but... it doesn't appear to.
I just can't have both running at the same time. If I have XAMP running (which is on a completely different drive than pws) pws won't even start.... I'm thinking you might be able to have both running if you change the port for one of them?

If I close XAMP then I can run PWS and vice versus

rmfred
rmfred's picture
Offline
Elder
Rock Springs, WY
Last seen: 3 years 38 weeks ago
Rock Springs, WY
Timezone: GMT-6
Joined: 2004-01-31
Posts: 1073
Points: 31

Way off topic... PHP and PWS

Now I get the following error when trying to update a database
PHP Parse error: syntax error, unexpected T_VARIABLE in C:\PHP\mytests\dbinsert.php on line 10

The db gets updated but don't know what causes the error.
Here is the code

<?php
$db = 'C:\\php\\mytests\\academics1.mdb';
$conn = new COM('ADODB.Connection');// or exit('Cannot start ADO.');
// Two ways to connect. Choose one.
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db");// or exit('Cannot open with Jet.');
//$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$db");// or exit('Cannot open with driver.');
$sql = "INSERT INTO activities (id, course) VALUES('11', 'cork')"; 
$rs = $conn->Execute($sql);
$rs.update
$rs->Close();
$conn->Close();
$rs = null;
$conn = null;
?>

And line 10 is this

$rs->Close();

If I put a ; after $rs.update I get this

PHP Notice: Use of undefined constant update - assumed 'update' in C:\PHP\mytests\dbinsert.php on line 9 PHP Fatal error: Uncaught exception 'com_exception' with message 'Source: ADODB.Recordset
Description: Operation is not allowed when the object is closed.' in C:\PHP\mytests\dbinsert.php:10 Stack trace: #0 C:\PHP\mytests\dbinsert.php(10): variant->Close() #1 {main} thrown in C:\PHP\mytests\dbinsert.php on line 10

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

You wont be able to run two servers both running on localhost or 127.0.0.1 you'll need to change the port one of them is listening on I think that should work.

Rmfred sounds like you have error reporting on the T_VARIABLE is due to the missing line terminator ;

The undefined constant sounds as though you possibly have not defined your constant variable initially ? constants have to be set initially with something like: define("UPDATE", "value of update") and I think that constants must always be written in uppercase but I may be wrong on all of the above Smile initially try changing the line $rs.update to $rs.UPDATE

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Way off topic... PHP and PWS

Just a guess here as I do most of my stuff on LAMP (I do have a running XAMP? or is it WAMP?). If you have multiple webservers on the same machine you will need to configure them to listen to different ports.

Web traffic (http) normally takes place on (tcp?) port 80. A port may only have one listener. I strongly suspect that if a webserver can't access the port it needs at start up it will abort. If you are listening/running SSL you will need to do the same with it (default port 343, iirc).

Of course, if you are running Apache, you can configure it to do all sorts of things - including to behave like a proxy server and forward some of the requests it receives to another port - and so to another webserver.

Rmfred,

$rs.update 

The above line doesn't make sense in PHP. Its not terminated with a semi-colon. "." is the string concatenation operator, but I get the feeling you aren't doing any string concatenation there.

/sigh ... out-typed by Hugo, oh, the shame :oops:

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 8 years 49 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

Way off topic... PHP and PWS

rmfred - I taught myself ASP many years ago using the odd article and bits and pieces of info from the web, then I taught myself PHP and converted all my scripts (very simple ones by my standards of today), predominantly by judicious use of a 'search and replace' tool, followed by a line-by-line clean up of what was left. There is no question in my experience that PHP is more logical, flexible and powerful than ASP.

The one piece of advice I would give you is not to learn PHP (or ASP) scripting piecemeal as I did, as you are left with gapping gaps in your knowledge that you don't realise until those gaps cause you problems through a conceptual misunderstanding. If I had my time again, I would start with a good current book by Larry Ullman and would work through it in a structured, logical way. Good luck and yes, most people do need to read through the same sections of a book many times before the concepts click into place - just as with CSS Smile

Life's a b*tch and then you die!

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

slowcoach wrote:
sigh ... out-typed by Hugo, oh, the shame

and it comes to something when I out type someone, specially on this subject (Warning: take all my utterances on PHP with a large pinch of salt)

Roy's advice about a good book is sound, I have a Larry Ullman and it's very well written , tends to dive into projects slightly too quickly for my liking, but I recognize it's a good way of getting a thorough understanding.

Like Roy my initial approach to learning tended to be along the line of reading up on things I needed for a particular script/function and it is a very piecemeal method of learning and does, as I find, leave large gaps in ones understanding.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 37 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Way off topic... PHP and PWS

Just installed XAMPP and it was a completely painless process, but how do you go about changing the root folder for localhost? With IIS, you open the control panel and change the path to the home directory. Is there a similar utility for XAMPP or do you have to move folders around?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Way off topic... PHP and PWS

I just looked up XAMPP, wow you get a lot of stuff with it. Smile

If you are going to be working with MySQL, I'd recommend getting MySQL's own client apps as being much better than using phpMyAdmin. I still prefer their now discontinued MySQLCC, but the two new apps, MySQL Query Browser and MySQL Administrator are no slouches either. I'm not sure if they will run on non-NT based windows (ie. 95, 98 & ME).

There is also a Migration Toolkit to painless migrate other vendor's databases (e.g. Access) into MySQL. Unfortunately it isn't standalone, it requires the Java Runtime Environment.

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 37 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Way off topic... PHP and PWS

Chris..S wrote:
I just looked up XAMPP, wow you get a lot of stuff with it. Smile

Yeah you do and it's got a few nifty little demos that come with it too. But all I want at the moment is basic - just the ability to switch between sites (folders) without having to physically move the contents of folders into the top level of the htdocs folder.
You can it easy enough with IIS; you must be able to do it with this as well. One for tomorrow morning I think.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Way off topic... PHP and PWS

I don't know about XAMPP, my installation is a hotchpotch of separate installs with a WAMP install over the top then having some components disabled Smile

Anyhow, the site root directory is controlled by your apache configuration file. You should find that whereever XAMPP dropped your Apache.

whereever xamp is installed look for

/Apache2/conf/httpd.conf

open that file in your favourite text editor and search for "DocumentRoot". If its a standard httpd.conf it'll be around line 220 or so. Change the folder name after that to your webroot folder.

e.g.

DocumentRoot "C:/path/to/my/htdocs"

Of course, since you now have Apache, you don't need to continually switch from one site to another, you set up virtual host entries for each site.

NameVirtualHost   *:80

#the first entry is the default and is also used when there is no recognised site name
<VirtualHost *:80>
  DocumentRoot "/path/to/localhost/public_html"
  ServerName localhost
</VirtualHost>
<VirtualHost *:80>
  DocumentRoot "/path/to/www.somesite.com/public_html"
  ServerName www.somesite.com
</VirtualHost>
<VirtualHost *:80>
  DocumentRoot "/path/to/www.someothersite.com/public_html"
  ServerName www.someothersite.com
</VirtualHost>

Then you need to add the following lines to your hosts file (/windows/system32/drivers/etc/hosts)

127.0.0.1  www.somesite.com
127.0.0.1  www.someothersite.com

And you have a multi-site apache webserver.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

Xamp is a very tidy package (It does tend to get confused and talk to you in German sometimes though)

As I mentioned earlier one thing that ought to be done is to change the php.ini register globals setting from 'ON' to 'OFF' it is senseless to get misled by having variables available globally by default.

As Xamp states on it's default http://localhost index page it is a developers platform and as such is presumed to be installed and running on a lan behind a nat router/firewall and therefore it is configured to be as open as possible you wouldn't want it on an open WAN port.

It does have lots of goodies, ftp server(FileZilla) Sendmail, Mecurymail, webalizer, etc and very useful is the batch switch to swap from PHP 5 to PHP 4 so that you can test your scripts in both environments.

Tyssen with Apache everything is basically configured through the httpd.conf file, you want to set up some vhost containers (virtualhosts) to enable web addresses working from the root document directory, once set up if you enter the domain name in your hosts file or lmhosts file you should be able to point to that domain name as http://somedomain.com on your lan network. it's all fairly simple to do, I'd say probably simpler than IIS also it's worth reading up on Apache 'alias' directories as well which allow you to map different url paths that exist outside of the document root; there are loads of tutorials around and of course the Apache manual:

http://httpd.apache.org/docs/2.0/

Hugo.

Blast Chris wasn't so slow today :roll: and he's given examples

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Way off topic... PHP and PWS

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Way off topic... PHP and PWS

Hugo wrote:
and very useful is the batch switch to swap from PHP 5 to PHP 4 so that you can test your scripts in both environments.

Isn't windows able to run them both at the same time?

On Linux, I can run one as a module and the other as CGI (or both as CGI). Chalk one up for linux I guess Wink

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

Shock cripes how does that work two versions running at the same time ? surely that's not possible on any platform even if one as module and one as cgi or am I missing a fundamental here, anyway I'm sure XP can't handle that far too schizophrenic for it's delicate sensibilities.

Hugo

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Way off topic... PHP and PWS

With cgi, the webserver runs the script independently. Its less efficient as it needs to start up what ever handles the script each time. Running multiple versions of php is just the same as running php, perl & python on the same server. You still need to give the webserver some indication what will handle the script, that probably means using different extensions on your file names (e.g. php4, php5).

You've been mentioning gentoo recently ... all the details can be found http://www.gentoo.org/proj/en/php/php-upgrading.xml

There is also a neat php-select command to change between which version of php is run by default for each of cli, cgi, apache2 and apache1.3. Details are on the same link.

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 8 years 49 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

Way off topic... PHP and PWS

The only problem with running both module and CGI versions of PHP, is that you have to remember that you are also running two independent config (.ini) files. It's easy to forget, then one day you make a change to one of the .ini files and wonder why the h3ll it isn't affecting your scripts (which are running under the other version of course).

How we laughed when after a few hours of head scratching we finally remembered that we needed to change the other .ini file Laughing out loud ...NOT Evil

Life's a b*tch and then you die!

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

I see that's a bit clearer good link Chris so it seems I was completely wrong and you can quite easily run parallel php using script alias in a vhost container and in a windows environment as I found out in this link:
http://www.circle.ch/blog/p1387.html

Well you learn something new everyday Smile


Sadly where Gentoo is concerned I shelved my plans to install it after reading a Linux gurus run through of the install procedure and frustrations and length of time taken Shock

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Way off topic... PHP and PWS

Hence the XAMPP or did you go with another distro?

Gentoo is not "that difficult". This is the walk-through I use. It will still take some time, but most of that is its running time not your time. Apache, MySQL, etc all take some time to configure correctly. Getting to grips with linux after that takes time, but I'd assume that is the same no matter what distro you use.

From the sound of what kk5st has been saying recently, grabbing packages for his distro and installing them is pretty painless too.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

I went with the OS version of SuSe 10.0 as the install is far less painful, Xamp was just for my spare XP box , although on my main working box I have a customized Win AMP setup which is essentially the Win compiled versions of the core components .

Configuring AMP for Linux is I guess a little harder than windows yet it is it's correct platform once I get things sorted my linux box will run my main AMP server and the Windows versions will be fairly redundant.

I loved the sound of Gentoo, partly due to what sounds like the best package installer I've read about and in general it does sound mightily funky yet I know that the basic install and compiling is going to take around 4-5 hours with further time needed to actually get a friendly front end running Smile all that given that it doesn't just give up halfway through and you have to start all over, I had read that walk through but also a much more detailed step by step version by someone clearly skilled and it did put me off a little Smile

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

rmfred
rmfred's picture
Offline
Elder
Rock Springs, WY
Last seen: 3 years 38 weeks ago
Rock Springs, WY
Timezone: GMT-6
Joined: 2004-01-31
Posts: 1073
Points: 31

Way off topic... PHP and PWS

Thanks for hijacking my thread guys Smile no seriously, some good info in your replies.

I learned ASP in much the same manner as mentioned... a bit here a bit there, find a script and modify to suit my needs etc etc. Not the best way but it worked. I think a more structued approach is probably needed for my intro to PHP... I'll check into a book(Drunk by the author mentioned Larry Ullman.

Now... regarding the discussion on document root and httpd files modification....
My Xampp install seems to be a bit different... although the document root says this:
DocumentRoot "D:/Program Files/xampp/htdocs"
it doesn't appear to actually be that... because if I stick a test php page into that folder, it isn't found by the browser.
BUT, if I stick it here:
D:\Program Files\Xampp\htdocs\xampp\
then it works.

So can anyone explain what's going on here?
thanks

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

At a semi educated guess and if you have left the default files in place you may be running foul of 'DirectoryIndexes' where you list the file extensions opened automatically.

If one were to use :
htdocs/ without specifying a file name; Xamp is set to look for file extensions .html , .htm, .php in that order if you dropped a php file into htdocs and ran http://localhost the default Xamp page would still be found as it is index.html you could try changing the index.html to something else and then see if your php file works.

The htdoc/xamp directory only has a shtml file in place which should be overridden by an index.php file.

Of course you may not be using index files at all and I may well be barking up the wrong tree altogether

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 17 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Way off topic... PHP and PWS

Tyssen wrote:
Just installed XAMPP and it was a completely painless process, but how do you go about changing the root folder for localhost? With IIS, you open the control panel and change the path to the home directory. Is there a similar utility for XAMPP or do you have to move folders around?
Open the Apache configuration file and search for "DocumentRoot". Edit the entry to conform to your chosen path. For a Win environment, that might be:

DocumentRoot c:\www

or you may have to use *nix syntax;

DocumentRoot c:/www

Where www is the docroot directory.

Do not confuse DocumentRoot and ServerRoot. The latter is the top of the directory tree where the configuration, error and log files are kept, though I put log/error files elsewhere.

Configuring Apache is done too seldom and is too simple to worry about 'tools'. Of course this is from a guy that would rather work from a cli than in some kind of gui. YMMV.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 37 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Way off topic... PHP and PWS

kk5st wrote:
Of course this is from a guy that would rather work from a cli than in some kind of gui. YMMV.

Sometimes, Gary, you speak a foreign language. :-s

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

Laughing out loud Gary I think it was covered about 8 posts back.

Configuring apache is text file work Tyssen all you need is your favorite text editor that and knowing how to issue command line restart without shutdown to read changes.

Hugo.

Gaza does like to speak in tongues Smile 'cli' = command line interface or that funny box and 'gui' = that which Linux geeks hate and despise so much the graphical user interface coz it makes things too easy and just is not l33t or hack0r for them to be seen dead using Smile

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 37 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Way off topic... PHP and PWS

Yeah, I think I've got a good handle on the apache config now (just gotta wait till I get home again).

Hugo wrote:
'cli' = command line interface or that funny box

That's the one I didn't know. And YMMV.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

I think it's got something to do with your millage may vary which may be some arcane reference to work productivity, Gary's favorite subject when it comes cli, emacs and Linux stuff.

Oh I'm in for it now

8-[

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 17 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Way off topic... PHP and PWS

Hugo: Yeah, I have a bad habit of clicking to post a reply, then decide to check some reference or another, write a bit, grab a snack, check the mail—nope not here yet, run some errands, get some actual stuff done, notice the unfinished post, add a bit to it and click submit. By then, someone else has answered and the thread has drifted another direction.

Tyssen: The cli is the source of all power. A gui allows you to do things easily, but only those things the app author thought you needed to be doing. And, a gui is often slower to use than the terminal. FileZilla is a good example. I put it on my Winbox because Windows's ftp client sucks hind teat on a boar hog. By the time you click here and there, and still can't do many of the file management tasks, you could already be typing 'bye' into the Gnu ftp app.

No one raised on the DOS shell has a clue about the power available at the command line when the shell is Bash, et al.

YMMV, your mileage may vary; you may do better or worse, or arrive at a different conclusion. From the tag line of car ads bragging about the fuel economy to be found in ______ model automobiles.Smile

cheers,

gary

ps I notice this post was actually started nearly 3 hours ago. :?

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Way off topic... PHP and PWS

Quote:
By then, someone else has answered and the thread has drifted another direction.


Gary the solution is simple rather than wait until such time as your post is finished, just submit a blank post thus reserving a position in the thread, then it is simply a matter of editing said post to reflect any subsequent replies, this way you'll look as though you have said it all first Smile

The cli is I agree the source of all power but then it would be as it is the original interface between human and processor the gui was only ever a sop to laziness and as it is essentially another programme bolted on top of the OS is never going to be as fast and just acts as another drain on system resources.

Quote:
No one raised on the DOS shell has a clue about the power available at the command line when the shell is Bash, et al.


I resent that Smile I was firmly raised on the cli albeit DOS in the days before gui/Win 3.1 and as such do realise that it's not as powerful as the Unix command line, but at least I'm not afraid of it

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 17 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Way off topic... PHP and PWS

I should have said anyone acquainted only with DOS. Smile

A blank post???

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 37 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Way off topic... PHP and PWS

Chris..S wrote:

NameVirtualHost   *:80

#the first entry is the default and is also used when there is no recognised site name
<VirtualHost *:80>
  DocumentRoot "/path/to/localhost/public_html"
  ServerName localhost
</VirtualHost>
<VirtualHost *:80>
  DocumentRoot "/path/to/www.somesite.com/public_html"
  ServerName www.somesite.com
</VirtualHost>


I've done all this and added the entries to Windows' hosts file and restarted the server but I get a 403 on the sites I'm trying to connect to. Even though I'm on a Windows machine do I have to use chmod to set the permissions?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Way off topic... PHP and PWS

You shouldn't need to change permissions, although that depends on how your windows box is configured. If those files/directories can be read by anyone (or any service) apache should work fine.

What do your apache logs say?
They'll give you a good indication of what is causing any error.

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 37 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Way off topic... PHP and PWS

Quote:
client denied by server configuration:

I guess I've set it up wrong. :? That's what you get for doing this too late at night. This is what I've got though:

<VirtualHost *:80>
  DocumentRoot "pathto/htdocs"
  ServerName localhost
</VirtualHost>

<VirtualHost *:80>
  DocumentRoot pathto/folder
  ServerName folder.local
</VirtualHost>

127.0.0.1 localhost
127.0.0.1 folder.local

localhost still works fine.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 37 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Way off topic... PHP and PWS

Do you have to set up one of these for each site too?

<Directory "C:/....">
     Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
 </Directory>

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 37 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Way off topic... PHP and PWS

It turns out it is to do with the <directory /> directives. Setting Order allow,deny and Allow from all fixed the problem but I'm just wondering if there are any security problems with this even though it's just on my local machine behind a software firewall?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Way off topic... PHP and PWS

I guess. I can't see the rest of your config file to know Wink

From what you are saying it looks like things may be set up so apache denies access to every file, then you need to allow access to files below each document root. My setup is different and that doesn't seem to be necessary - besides, I thought Apache automatically denied everything below the document root which is why you need to use <directory> blocks to allow access when Alias and ScriptAlias are used.