New to PHP and struggling with the basics

New to PHP and struggling with the basics

am 04.10.2010 11:30:33 von Col Day

Hi all,

Working with the PHP5 for Dummies book (yup real noob, feel free to ridicule
(after telling me what I've done wrong)) and have installed Apache 2.2 and
PHP 5.3.3 onto a laptop running Vista. (yes I know!!!).

I've had Apache running fine with my basic web site created using Serif's
Webplus10 but wanted to experiment with PHP as I want an uploadable area on
my website for my friends and family to submit video/photos.

I've checked the install of PHP using php -v and I get the output that

PHP 5.3.3 (cli) (built: Jul 21 2010 20:10:20)

but when I try and go to the test.php file (below) I get an http 403 webiste
requires you to log in. Error message.



PHP Test


This is an HTML line
echo "

This is a PHP line

";
phpinfo();
?>



This is the text of the test.php file which I have plonked down in
/apache/htdocs

What have I missed?

the Dummies book is quoting PHP 5.0.0 as the latest release so not too far
away really.

Thanks for your help.

Cheers.

Col Day



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: New to PHP and struggling with the basics

am 04.10.2010 11:34:50 von Peter Lind

On 4 October 2010 11:30, Col Day wrote:
> Hi all,
>
> Working with the PHP5 for Dummies book (yup real noob, feel free to ridicule
> (after telling me what I've done wrong)) and have installed Apache 2.2 and
> PHP 5.3.3 onto a laptop running Vista. (yes I know!!!).
>
> I've had Apache running fine with my basic web site created using Serif's
> Webplus10 but wanted to experiment with PHP as I want an uploadable area on
> my website for my friends and family to submit video/photos.
>
> I've checked the install of PHP using php -v and I get the output that
>
> PHP 5.3.3 (cli) (built: Jul 21 2010 20:10:20)
>
> but when I try and go to the test.php file (below) I get an http 403 webiste
> requires you to log in. Error message.
>
>
>
> PHP Test
>
>
>

This is an HTML line
> > echo "

This is a PHP line

";
> phpinfo();
> ?>
>
>
>
> This is the text of the test.php file which I have plonked down in
> /apache/htdocs
>
> What have I missed?
>
> the Dummies book is quoting PHP 5.0.0 as the latest release so not too far
> away really.
>

A) v5.0.0 is years old. B) your issue is with apache, not php - 403 is
a "you have no permission to see this".

Check permissions for the file you're trying to test, as well as for
the folder. Also, seeing as you're naming the file test.php, make sure
you're browsing for that file and not just / or index.php.

Regards
Peter

--

WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: New to PHP and struggling with the basics

am 04.10.2010 11:53:57 von kranthi

apache error logs will be helpful in this case. Their location varies
depending upon your installation. But in any case they'll be insde
your server directory (IIRC it is c:/Program Files/Apache Software
Foundation/Apache by default)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: New to PHP and struggling with the basics

am 04.10.2010 12:20:18 von joefazee

Your directory configuration should look like this


Order Deny,Allow
Allow from all

Options Indexes FollowSymLinks Includes ExecCGI

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All



On Mon, Oct 4, 2010 at 10:53 AM, kranthi wrote:
> apache error logs will be helpful in this case. Their location varies
> depending upon your installation. But in any case they'll be insde
> your server directory (IIRC it is c:/Program Files/Apache Software
> Foundation/Apache by default)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Share with free mind!
Join the world largest open forum for hackers and programmers.
http://www.tuwana.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: New to PHP and struggling with the basics

am 04.10.2010 12:55:22 von Col Day

Kranthi
Many thanks, any idea on the name of the error logs?

Peter,
Yes, browsing to the correct location but still getting the 403. this
website requires you to log in.

Abah,

I've gone to the httpd-userdir.conf file and replaced it with your text (not
including the directory tree), restarted apache (after each change) but am
still getting the same error.

However I have found that if I paste the html into my web page created by
Serif WebPlus 10 I get the "html" line but not the "php" line.

Any further thoughts?

It has to be something simple that I'vw not done!

Cheers all.



"kranthi" wrote in message
news:AANLkTik6=68Ho+HdFpVd3x2QmrUdLz_ttcO2Oqk1BM0f@mail.gmai l.com...
> apache error logs will be helpful in this case. Their location varies
> depending upon your installation. But in any case they'll be insde
> your server directory (IIRC it is c:/Program Files/Apache Software
> Foundation/Apache by default)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: New to PHP and struggling with the basics

am 04.10.2010 13:48:22 von kranthi

they should be something like error_log-[date] not sure about windows though

>>However I have found that if I paste the html into my web page created by Serif WebPlus 10 I get the "html" line but not the "php" line.

are you saying that you are getting the php code in your browser ?
echo "

This is a PHP line

";
phpinfo();
?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RES: New to PHP and struggling with the basics

am 04.10.2010 14:27:07 von Alejandro Michelin Salomon

Col Day :

Go to : "C:\Arquivos de programas\Apache Software Foundation\Apache2.2\conf"
or the folder in your machine.

Search for this file => httpd.conf

Search for DocumentRoot "D:/webroot" put your work folder in my case
D:/webroot.

Search for this line and apply the same changes make in DocumentRoot
#
# This should be changed to whatever you set DocumentRoot to
#


Search for DirectoryIndex, and add index.php to the list

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#

DirectoryIndex index.html index.php


Add on the end of the file this lines :

My php installation folder is D:/PHP/, change D:/PHP/ to your installation
folder.

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "D:/PHP/"

# Php as Apache module
LoadModule php5_module "D:/PHP/php5apache2_2.dll"

Restart apache.

Browse to localhost

Alejandro M.S.

-----Mensagem original-----
De: Col Day [mailto:colinday3@aol.com]
Enviada em: segunda-feira, 4 de outubro de 2010 06:31
Para: php-general@lists.php.net
Assunto: [PHP] New to PHP and struggling with the basics

Hi all,

Working with the PHP5 for Dummies book (yup real noob, feel free to ridicule
(after telling me what I've done wrong)) and have installed Apache 2.2 and
PHP 5.3.3 onto a laptop running Vista. (yes I know!!!).

I've had Apache running fine with my basic web site created using Serif's
Webplus10 but wanted to experiment with PHP as I want an uploadable area on
my website for my friends and family to submit video/photos.

I've checked the install of PHP using php -v and I get the output that

PHP 5.3.3 (cli) (built: Jul 21 2010 20:10:20)

but when I try and go to the test.php file (below) I get an http 403 webiste
requires you to log in. Error message.



PHP Test


This is an HTML line
echo "

This is a PHP line

";
phpinfo();
?>



This is the text of the test.php file which I have plonked down in
/apache/htdocs

What have I missed?

the Dummies book is quoting PHP 5.0.0 as the latest release so not too far
away really.

Thanks for your help.

Cheers.

Col Day



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: New to PHP and struggling with the basics

am 04.10.2010 14:51:57 von Col Day

Hi Kranthi,

No, I just literally get the "HTML" line shown but absolutely nothing
beneath it.

"kranthi" wrote in message
news:AANLkTin2xnthqM-Pp7qwtGO=SQtKcttHtWz+08BbWCyF@mail.gmai l.com...
> they should be something like error_log-[date] not sure about windows
> though
>
>>>However I have found that if I paste the html into my web page created by
>>>Serif WebPlus 10 I get the "html" line but not the "php" line.
>
> are you saying that you are getting the php code in your browser ?
> > echo "

This is a PHP line

";
> phpinfo();
> ?>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: New to PHP and struggling with the basics

am 04.10.2010 16:30:53 von Steven Staples

Col.

Since you're new to php, then an easy way to install apache, is using
XAMPP ( http://www.apachefriends.org/en/xampp.html )

I would suggest you remove the apache you have installed, and the php
you installed, and install the XAMPP package as it comes prebuilt with
mysql, ftp, apache and php, and it is simple to use/work with.

And if you install to defaults there, you will put your web files into
C:\xampp\htdocs\ and everythign should just work.

The way i read your initial post, is that you installed just apache, and
just php... if you did this, then you may not have integrated php into
apache properly, so then your php pages will not work.

just my $0.02 here, cuz if it doesn't work after you install XAMPP, then
there is something else wrong.

And the other thing, is that you're running on vista, and vista doesn't
like things running on localhost (or at least it didn't used to)

Steve


On Mon, 2010-10-04 at 13:51 +0100, Col Day wrote:
> Hi Kranthi,
>
> No, I just literally get the "HTML" line shown but absolutely nothing
> beneath it.
>
> "kranthi" wrote in message
> news:AANLkTin2xnthqM-Pp7qwtGO=SQtKcttHtWz+08BbWCyF@mail.gmai l.com...
> > they should be something like error_log-[date] not sure about windows
> > though
> >
> >>>However I have found that if I paste the html into my web page created by
> >>>Serif WebPlus 10 I get the "html" line but not the "php" line.
> >
> > are you saying that you are getting the php code in your browser ?
> > > > echo "

This is a PHP line

";
> > phpinfo();
> > ?>
>
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: New to PHP and struggling with the basics

am 04.10.2010 17:41:20 von Col Day

Steve,

That's superb, many thanks for the link! I shall give it a go!

Yes I did install apache then php, however I tried to follow the
instructions in the Dummies book (what does it make me if I can't follow the
dummies book?) but to no avail.

I have just printed off the first 40 pages so that i can read it whilst
looking at the screen ratrher than switching about, however I will give
Xammp a go first and foremost seeing as I only want to test my own web page
before I start to buy hosting elsewhere.

Seeing as you are so great :-) Any ideas of the best way to script an upload
page that will deliver files to the server?

Family photo's and video clips mainly.

Thoughts?

Also, many thanks to everyone who has tried to help a muppet. But I guess we
all gotta start somewhere!

Cheers again!

"Steve Staples" wrote in message
news:1286202653.4703.48.camel@webdev01...
> Col.
>
> Since you're new to php, then an easy way to install apache, is using
> XAMPP ( http://www.apachefriends.org/en/xampp.html )
>
> I would suggest you remove the apache you have installed, and the php
> you installed, and install the XAMPP package as it comes prebuilt with
> mysql, ftp, apache and php, and it is simple to use/work with.
>
> And if you install to defaults there, you will put your web files into
> C:\xampp\htdocs\ and everythign should just work.
>
> The way i read your initial post, is that you installed just apache, and
> just php... if you did this, then you may not have integrated php into
> apache properly, so then your php pages will not work.
>
> just my $0.02 here, cuz if it doesn't work after you install XAMPP, then
> there is something else wrong.
>
> And the other thing, is that you're running on vista, and vista doesn't
> like things running on localhost (or at least it didn't used to)
>
> Steve
>
>
> On Mon, 2010-10-04 at 13:51 +0100, Col Day wrote:
>> Hi Kranthi,
>>
>> No, I just literally get the "HTML" line shown but absolutely nothing
>> beneath it.
>>
>> "kranthi" wrote in message
>> news:AANLkTin2xnthqM-Pp7qwtGO=SQtKcttHtWz+08BbWCyF@mail.gmai l.com...
>> > they should be something like error_log-[date] not sure about windows
>> > though
>> >
>> >>>However I have found that if I paste the html into my web page created
>> >>>by
>> >>>Serif WebPlus 10 I get the "html" line but not the "php" line.
>> >
>> > are you saying that you are getting the php code in your browser ?
>> > >> > echo "

This is a PHP line

";
>> > phpinfo();
>> > ?>
>>
>>
>
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: New to PHP and struggling with the basics

am 04.10.2010 18:33:39 von Col Day

In addition, I think I may have got to the bottom of what I was doing wrong
in the first place.

I recently swapped out my laptop for my wifes one (she upgraded, well I
upgraded hers, and I got the old one) and I forgot that this one didn't
automatically boot up into the Administrator profile.

Doh!

Cheers again all!


""Col Day"" wrote in message
news:A2.70.25536.9A5F9AC4@pb1.pair.com...
> Steve,
>
> That's superb, many thanks for the link! I shall give it a go!
>
> Yes I did install apache then php, however I tried to follow the
> instructions in the Dummies book (what does it make me if I can't follow
> the dummies book?) but to no avail.
>
> I have just printed off the first 40 pages so that i can read it whilst
> looking at the screen ratrher than switching about, however I will give
> Xammp a go first and foremost seeing as I only want to test my own web
> page before I start to buy hosting elsewhere.
>
> Seeing as you are so great :-) Any ideas of the best way to script an
> upload page that will deliver files to the server?
>
> Family photo's and video clips mainly.
>
> Thoughts?
>
> Also, many thanks to everyone who has tried to help a muppet. But I guess
> we all gotta start somewhere!
>
> Cheers again!
>
> "Steve Staples" wrote in message
> news:1286202653.4703.48.camel@webdev01...
>> Col.
>>
>> Since you're new to php, then an easy way to install apache, is using
>> XAMPP ( http://www.apachefriends.org/en/xampp.html )
>>
>> I would suggest you remove the apache you have installed, and the php
>> you installed, and install the XAMPP package as it comes prebuilt with
>> mysql, ftp, apache and php, and it is simple to use/work with.
>>
>> And if you install to defaults there, you will put your web files into
>> C:\xampp\htdocs\ and everythign should just work.
>>
>> The way i read your initial post, is that you installed just apache, and
>> just php... if you did this, then you may not have integrated php into
>> apache properly, so then your php pages will not work.
>>
>> just my $0.02 here, cuz if it doesn't work after you install XAMPP, then
>> there is something else wrong.
>>
>> And the other thing, is that you're running on vista, and vista doesn't
>> like things running on localhost (or at least it didn't used to)
>>
>> Steve
>>
>>
>> On Mon, 2010-10-04 at 13:51 +0100, Col Day wrote:
>>> Hi Kranthi,
>>>
>>> No, I just literally get the "HTML" line shown but absolutely nothing
>>> beneath it.
>>>
>>> "kranthi" wrote in message
>>> news:AANLkTin2xnthqM-Pp7qwtGO=SQtKcttHtWz+08BbWCyF@mail.gmai l.com...
>>> > they should be something like error_log-[date] not sure about windows
>>> > though
>>> >
>>> >>>However I have found that if I paste the html into my web page
>>> >>>created by
>>> >>>Serif WebPlus 10 I get the "html" line but not the "php" line.
>>> >
>>> > are you saying that you are getting the php code in your browser ?
>>> > >>> > echo "

This is a PHP line

";
>>> > phpinfo();
>>> > ?>
>>>
>>>
>>
>>
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: New to PHP and struggling with the basics

am 05.10.2010 13:23:21 von unknown

Post removed (X-No-Archive: yes)

Re: New to PHP and struggling with the basics

am 05.10.2010 13:56:09 von Col Day

Thanks Gary!

Nice to know I'm not the only one who has struggled with the Basics.
Hopefully I can get my brain around it sometime soon.

Cheers

Col.

"Gary" wrote in message
news:i8f1r9$j4r$1@dough.gmane.org...
> Col Day wrote:
>> Yes I did install apache then php, however I tried to follow the
>> instructions in the Dummies book (what does it make me if I can't follow
>> the dummies book?) but to no avail.
>
> Don't know what it makes you, but I remember trying to install Apache &
> PHP separately a couple of years ago. The frustration of mismatching
> versions (Apache only supporting PHP version something, PHP only playing
> well with Apache version something-else) was... rather high. Head met
> keyboard several times.
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php