FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » using scripting languages to automate a browser
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
using scripting languages to automate a browser [message #180398] Sun, 10 February 2013 08:04 Go to next message
Cal Dershowitz is currently offline  Cal Dershowitz
Messages: 36
Registered: February 2013
Karma: 0
Member
Hello newsgroup,

I've been trying to use perl to automate processes that aren't much more
than a few GUI events that a person would do if he had a browser.

#!/usr/bin/perl -w
use strict;
use autodie;
use utf8;
use WWW::Mechanize;

my $url = 'http://translate.google.com/';
my $mech = WWW::Mechanize->new;
my $result = $mech->get($url);
die "GET failedn" unless $result->is_success;


my $filename = 'content1.txt';
$mech->save_content($filename);


my @links = $mech->links();
print "tags\n";
print $_->tag()."\n" foreach @links;
print "URI\n";
print $_->URI()."\n" foreach @links;
print "text\n";
print $_->text()."\n" foreach @links;
print "forms\n";
my @forms = $mech->forms();
# print $_->text()."\n" foreach @forms;
$mech->current_form()

With the amount of difficulty that this has presented itself to be, I've
started to wonder whether I'm not using a wrench to pound a nail. What
I'm trying to do in this instance is to click a button to turn the
language, enter the text that I would have in a file, click translate,
and capture the output.

Is this something that php can do in a way that involves less grief?

Thanks for your comment, and cheers.
--
Cal Dershowitz
Re: using scripting languages to automate a browser [message #180399 is a reply to message #180398] Sun, 10 February 2013 09:03 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 10.02.2013 09:04, schrieb Cal Dershowitz:
> Hello newsgroup,
>
> I've been trying to use perl to automate processes that aren't much more than a few
> GUI events that a person would do if he had a browser.
>
> #!/usr/bin/perl -w
> use strict;
> use autodie;
> use utf8;
> use WWW::Mechanize;
>
> my $url = 'http://translate.google.com/';
--cut--

> print "URI\n";
> print $_->URI()."\n" foreach @links;
> print "text\n";
> print $_->text()."\n" foreach @links;
> print "forms\n";
> my @forms = $mech->forms();
> # print $_->text()."\n" foreach @forms;
> $mech->current_form()
>
> With the amount of difficulty that this has presented itself to be, I've started to
> wonder whether I'm not using a wrench to pound a nail. What I'm trying to do in this
> instance is to click a button to turn the language, enter the text that I would have
> in a file, click translate, and capture the output.
>
> Is this something that php can do in a way that involves less grief?
>
> Thanks for your comment, and cheers.

In PHP you would have to issue more or less the same commands/use the same functions.

I think the approach is wrong. Most probably there is a way to encode the whole query
in the url, or there is a API/Service that does what you want.

If the API does not exist, or is too expensive, you could either just provide the
translation link, or you must go through all the "grief", and again when the layout
changes.

/Str.
Re: using scripting languages to automate a browser [message #180400 is a reply to message #180398] Sun, 10 February 2013 09:49 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Cal Dershowitz, 2013-02-10 09:04:

> Hello newsgroup,
>
> I've been trying to use perl to automate processes that aren't much more
> than a few GUI events that a person would do if he had a browser.
>
> #!/usr/bin/perl -w
> use strict;
> use autodie;
> use utf8;
> use WWW::Mechanize;
>
> my $url = 'http://translate.google.com/';
> my $mech = WWW::Mechanize->new;
> my $result = $mech->get($url);
> die "GET failedn" unless $result->is_success;
[...]

> Is this something that php can do in a way that involves less grief?

I don't think so.

But if you need to use Google Translate as a service, see here:

<https://developers.google.com/translate/>

Well - the service is not for free. Therefore i doubt that using
<http://translate.google.com/> as a "service" through scripts is legal.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180402 is a reply to message #180400] Mon, 11 February 2013 02:58 Go to previous messageGo to next message
Cal Dershowitz is currently offline  Cal Dershowitz
Messages: 36
Registered: February 2013
Karma: 0
Member
On 02/10/2013 02:49 AM, Arno Welzel wrote:
> Cal Dershowitz, 2013-02-10 09:04:

[x-posted to alt.os.linux.ubuntu]


>> I've been trying to use perl to automate processes that aren't much more
>> than a few GUI events that a person would do if he had a browser.
>>
>> #!/usr/bin/perl -w
>> use strict;
>> use autodie;
>> use utf8;
>> use WWW::Mechanize;
>>
>> my $url = 'http://translate.google.com/';
>> my $mech = WWW::Mechanize->new;
>> my $result = $mech->get($url);
>> die "GET failedn" unless $result->is_success;
> [...]
>
>> Is this something that php can do in a way that involves less grief?
>
> I don't think so.
>
> But if you need to use Google Translate as a service, see here:
>
> <https://developers.google.com/translate/>
>
> Well - the service is not for free. Therefore i doubt that using
> <http://translate.google.com/> as a "service" through scripts is legal.
>
>

Thanks for your comments, Arno, I'm just trying to get used to websites
from the point-of-view of machines. I don't want this as a "service"
that I would put on my guinea pig 1and1 website. With all the reading I
did, I do want to use php on my website now.

I think we're all in agreement that php is the wrong tool for what I
wanted to do, but I've always wanted to have more-sophisticated content
on my own site, in particular the ability to host video.

The tutorial I looked at wants me to install XAMPP. Is that the best
idea for getting a php development environment squared away given that this

$ uname -a
Linux fred-desktop 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18
16:39:21 UTC 2012 i686 athlon i386 GNU/Linux

is my platform? As I look through synaptic for packages that match php,
there might be 2 hundred.

Before I went ahead and fiddled with it, I thought I'd ask to see if
someone has been around the block on this once, which is one more than
me right now.
--
Cal
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180404 is a reply to message #180402] Mon, 11 February 2013 11:39 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 11.02.2013 03:58, schrieb Cal Dershowitz:
> On 02/10/2013 02:49 AM, Arno Welzel wrote:
>> Cal Dershowitz, 2013-02-10 09:04:
>
> [x-posted to alt.os.linux.ubuntu]
>
>
>>> I've been trying to use perl to automate processes that aren't much more
>>> than a few GUI events that a person would do if he had a browser.
>>>
>>> #!/usr/bin/perl -w
>>> use strict;
>>> use autodie;
>>> use utf8;
>>> use WWW::Mechanize;
>>>
>>> my $url = 'http://translate.google.com/';
>>> my $mech = WWW::Mechanize->new;
>>> my $result = $mech->get($url);
>>> die "GET failedn" unless $result->is_success;
>> [...]
>>
>>> Is this something that php can do in a way that involves less grief?
>>
>> I don't think so.
>>
>> But if you need to use Google Translate as a service, see here:
>>
>> <https://developers.google.com/translate/>
>>
>> Well - the service is not for free. Therefore i doubt that using
>> <http://translate.google.com/> as a "service" through scripts is legal.
>>
>>
>
> Thanks for your comments, Arno, I'm just trying to get used to websites from the
> point-of-view of machines. I don't want this as a "service" that I would put on my
> guinea pig 1and1 website. With all the reading I did, I do want to use php on my
> website now.
>
> I think we're all in agreement that php is the wrong tool for what I wanted to do,
> but I've always wanted to have more-sophisticated content on my own site, in
> particular the ability to host video.
>
> The tutorial I looked at wants me to install XAMPP. Is that the best idea for
> getting a php development environment squared away given that this
>
> $ uname -a
> Linux fred-desktop 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18 16:39:21 UTC 2012
> i686 athlon i386 GNU/Linux
>
> is my platform? As I look through synaptic for packages that match php, there might
> be 2 hundred.
>
> Before I went ahead and fiddled with it, I thought I'd ask to see if someone has been
> around the block on this once, which is one more than me right now.

Linux/Unix is the native platform for PHP development. Get a decent IDE with syntax
checking, set all encodings to utf-8, start your local web server and there you go.

/Str.
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180405 is a reply to message #180402] Mon, 11 February 2013 13:40 Go to previous messageGo to next message
Warren Post is currently offline  Warren Post
Messages: 2
Registered: February 2013
Karma: 0
Junior Member
On 02/10/2013 08:58 PM, Cal Dershowitz wrote:
> The tutorial I looked at wants me to install XAMPP. Is that the best
> idea for getting a php development environment squared away given that this
>
> $ uname -a
> Linux fred-desktop 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18
> 16:39:21 UTC 2012 i686 athlon i386 GNU/Linux
>
> is my platform?

I have a strong preference for using my distro's packages when available
rather than 3rd party products. In your case, that would be Ubuntu's
Apache, either MySQL or MariaDB, and PHP, installed and tested in that
order. This combination is called LAMP.

I haven't had opportunity to set up a LAMP server on Ubuntu, but perhaps
the notes I took when doing it on Mandriva will help you get going:

http://my.opera.com/wpost/blog/index.dml/tag/LAMP

--
Warren Post
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180406 is a reply to message #180404] Mon, 11 February 2013 14:29 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 2/11/2013 6:39 AM, M. Strobel wrote:
> Am 11.02.2013 03:58, schrieb Cal Dershowitz:
>> On 02/10/2013 02:49 AM, Arno Welzel wrote:
>>> Cal Dershowitz, 2013-02-10 09:04:
>>
>> [x-posted to alt.os.linux.ubuntu]
>>
>>
>>>> I've been trying to use perl to automate processes that aren't much more
>>>> than a few GUI events that a person would do if he had a browser.
>>>>
>>>> #!/usr/bin/perl -w
>>>> use strict;
>>>> use autodie;
>>>> use utf8;
>>>> use WWW::Mechanize;
>>>>
>>>> my $url = 'http://translate.google.com/';
>>>> my $mech = WWW::Mechanize->new;
>>>> my $result = $mech->get($url);
>>>> die "GET failedn" unless $result->is_success;
>>> [...]
>>>
>>>> Is this something that php can do in a way that involves less grief?
>>>
>>> I don't think so.
>>>
>>> But if you need to use Google Translate as a service, see here:
>>>
>>> <https://developers.google.com/translate/>
>>>
>>> Well - the service is not for free. Therefore i doubt that using
>>> <http://translate.google.com/> as a "service" through scripts is legal.
>>>
>>>
>>
>> Thanks for your comments, Arno, I'm just trying to get used to websites from the
>> point-of-view of machines. I don't want this as a "service" that I would put on my
>> guinea pig 1and1 website. With all the reading I did, I do want to use php on my
>> website now.
>>
>> I think we're all in agreement that php is the wrong tool for what I wanted to do,
>> but I've always wanted to have more-sophisticated content on my own site, in
>> particular the ability to host video.
>>
>> The tutorial I looked at wants me to install XAMPP. Is that the best idea for
>> getting a php development environment squared away given that this
>>
>> $ uname -a
>> Linux fred-desktop 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18 16:39:21 UTC 2012
>> i686 athlon i386 GNU/Linux
>>
>> is my platform? As I look through synaptic for packages that match php, there might
>> be 2 hundred.
>>
>> Before I went ahead and fiddled with it, I thought I'd ask to see if someone has been
>> around the block on this once, which is one more than me right now.
>
> Linux/Unix is the native platform for PHP development. Get a decent IDE with syntax
> checking, set all encodings to utf-8, start your local web server and there you go.
>
> /Str.
>

Incorrect. Linux is not the "native platform for PHP development". It
is ONE platform for PHP development. PHP runs fine on Windows, also.
And there are good IDE's on Windows, also.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180407 is a reply to message #180406] Mon, 11 February 2013 16:23 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 11.02.2013 15:29, schrieb Jerry Stuckle:
> On 2/11/2013 6:39 AM, M. Strobel wrote:
>> Am 11.02.2013 03:58, schrieb Cal Dershowitz:
>>> On 02/10/2013 02:49 AM, Arno Welzel wrote:
--
>>> The tutorial I looked at wants me to install XAMPP. Is that the best idea for
>>> getting a php development environment squared away given that this
>>>
>>> $ uname -a
>>> Linux fred-desktop 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18 16:39:21 UTC 2012
>>> i686 athlon i386 GNU/Linux
>>>
>>> is my platform? As I look through synaptic for packages that match php, there might
>>> be 2 hundred.
>>>
>>> Before I went ahead and fiddled with it, I thought I'd ask to see if someone has been
>>> around the block on this once, which is one more than me right now.
>>
>> Linux/Unix is the native platform for PHP development. Get a decent IDE with syntax
>> checking, set all encodings to utf-8, start your local web server and there you go.
>>
>> /Str.
>>
>
> Incorrect. Linux is not the "native platform for PHP development". It is ONE
> platform for PHP development. PHP runs fine on Windows, also. And there are good
> IDE's on Windows, also.
>

Unix/Linux is the native platform for web development, because the first web server
was on *nix, and it is still the primary platform (http://news.netcraft.com/).

/Str.
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180408 is a reply to message #180407] Mon, 11 February 2013 19:13 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 2/11/2013 11:23 AM, M. Strobel wrote:
> Am 11.02.2013 15:29, schrieb Jerry Stuckle:
>> On 2/11/2013 6:39 AM, M. Strobel wrote:
>>> Am 11.02.2013 03:58, schrieb Cal Dershowitz:
>>>> On 02/10/2013 02:49 AM, Arno Welzel wrote:
> --
>>>> The tutorial I looked at wants me to install XAMPP. Is that the best idea for
>>>> getting a php development environment squared away given that this
>>>>
>>>> $ uname -a
>>>> Linux fred-desktop 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18 16:39:21 UTC 2012
>>>> i686 athlon i386 GNU/Linux
>>>>
>>>> is my platform? As I look through synaptic for packages that match php, there might
>>>> be 2 hundred.
>>>>
>>>> Before I went ahead and fiddled with it, I thought I'd ask to see if someone has been
>>>> around the block on this once, which is one more than me right now.
>>>
>>> Linux/Unix is the native platform for PHP development. Get a decent IDE with syntax
>>> checking, set all encodings to utf-8, start your local web server and there you go.
>>>
>>> /Str.
>>>
>>
>> Incorrect. Linux is not the "native platform for PHP development". It is ONE
>> platform for PHP development. PHP runs fine on Windows, also. And there are good
>> IDE's on Windows, also.
>>
>
> Unix/Linux is the native platform for web development, because the first web server
> was on *nix, and it is still the primary platform (http://news.netcraft.com/).
>
> /Str.
>

It doesn't matter if the first web server was on *nix, nor that it is
still the primary platform for web development. Linux is *not* the
"native platform for PHP development".

In fact, I would almost bet there is more PHP *development* done on
Windows, even though *deployment* is done on *nix. Windows is, after
all, the predominant system on the desktop (where most development is done).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180410 is a reply to message #180405] Mon, 11 February 2013 20:20 Go to previous messageGo to next message
Cal Dershowitz is currently offline  Cal Dershowitz
Messages: 36
Registered: February 2013
Karma: 0
Member
On 02/11/2013 06:40 AM, Warren Post wrote:
> On 02/10/2013 08:58 PM, Cal Dershowitz wrote:
>> The tutorial I looked at wants me to install XAMPP. Is that the best
>> idea for getting a php development environment squared away given that
>> this
>>
>> $ uname -a
>> Linux fred-desktop 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18
>> 16:39:21 UTC 2012 i686 athlon i386 GNU/Linux
>>
>> is my platform?
>
> I have a strong preference for using my distro's packages when available
> rather than 3rd party products. In your case, that would be Ubuntu's
> Apache, either MySQL or MariaDB, and PHP, installed and tested in that
> order. This combination is called LAMP.
>
> I haven't had opportunity to set up a LAMP server on Ubuntu, but perhaps
> the notes I took when doing it on Mandriva will help you get going:
>
> http://my.opera.com/wpost/blog/index.dml/tag/LAMP
>

Thx all for responses. The tutorial I looked at talked of XAAMP, where
I was basically-ignorant of what the acronym might mean.

http://my.opera.com/wpost/blog/install-php

So I think I need the AMP part. I guess I'm assuming that the L was for
Linux. As I look at Apache in the synaptic package manager, I see 200
choices again.

You'd think that someone would have rolled the process togther a bit, as
many times as it has to have been done.
--
Cal
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180411 is a reply to message #180408] Mon, 11 February 2013 21:29 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 11.02.2013 20:13, schrieb Jerry Stuckle:
> On 2/11/2013 11:23 AM, M. Strobel wrote:
>> Am 11.02.2013 15:29, schrieb Jerry Stuckle:
>>>
>>> Incorrect. Linux is not the "native platform for PHP development". It is ONE
>>> platform for PHP development. PHP runs fine on Windows, also. And there are good
>>> IDE's on Windows, also.
>>>
>>
>> Unix/Linux is the native platform for web development, because the first web server
>> was on *nix, and it is still the primary platform (http://news.netcraft.com/).
>>
>> /Str.
>>
>
> It doesn't matter if the first web server was on *nix, nor that it is still the
> primary platform for web development. Linux is *not* the "native platform for PHP
> development".
>
> In fact, I would almost bet there is more PHP *development* done on Windows, even
> though *deployment* is done on *nix. Windows is, after all, the predominant system
> on the desktop (where most development is done).

yes, for the desktop, but not where most development is done.

Maybe I confound it with the question which desktop is best for *nix development, but
it just does not make sense develop for *nix on a MS Win desktop. You do not even
have a decent shell. MinGW and Cygwin are not THE REAL THING.

BTW I am not a MS hater, I had a Technet subscription with all MS operating systems
when I gave courses in MS Networking / Active Directory.
/Str.
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180412 is a reply to message #180410] Mon, 11 February 2013 21:32 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 11.02.2013 21:20, schrieb Cal Dershowitz:
> On 02/11/2013 06:40 AM, Warren Post wrote:
>> On 02/10/2013 08:58 PM, Cal Dershowitz wrote:
>>> The tutorial I looked at wants me to install XAMPP. Is that the best
>>> idea for getting a php development environment squared away given that
>>> this
>>>
>>> $ uname -a
>>> Linux fred-desktop 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18
>>> 16:39:21 UTC 2012 i686 athlon i386 GNU/Linux
>>>
>>> is my platform?
>>
>> I have a strong preference for using my distro's packages when available
>> rather than 3rd party products. In your case, that would be Ubuntu's
>> Apache, either MySQL or MariaDB, and PHP, installed and tested in that
>> order. This combination is called LAMP.
>>
>> I haven't had opportunity to set up a LAMP server on Ubuntu, but perhaps
>> the notes I took when doing it on Mandriva will help you get going:
>>
>> http://my.opera.com/wpost/blog/index.dml/tag/LAMP
>>
>
> Thx all for responses. The tutorial I looked at talked of XAAMP, where I was
> basically-ignorant of what the acronym might mean.
>
> http://my.opera.com/wpost/blog/install-php
>
> So I think I need the AMP part. I guess I'm assuming that the L was for Linux. As I
> look at Apache in the synaptic package manager, I see 200 choices again.
>
> You'd think that someone would have rolled the process togther a bit, as many times
> as it has to have been done.

There are generic packages with a good preselection for apache2, php, and mysql, no
need to go into package details for a starter.

/Str.
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180413 is a reply to message #180411] Mon, 11 February 2013 21:40 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 2/11/2013 4:29 PM, M. Strobel wrote:
> Am 11.02.2013 20:13, schrieb Jerry Stuckle:
>> On 2/11/2013 11:23 AM, M. Strobel wrote:
>>> Am 11.02.2013 15:29, schrieb Jerry Stuckle:
>>>>
>>>> Incorrect. Linux is not the "native platform for PHP development". It is ONE
>>>> platform for PHP development. PHP runs fine on Windows, also. And there are good
>>>> IDE's on Windows, also.
>>>>
>>>
>>> Unix/Linux is the native platform for web development, because the first web server
>>> was on *nix, and it is still the primary platform (http://news.netcraft.com/).
>>>
>>> /Str.
>>>
>>
>> It doesn't matter if the first web server was on *nix, nor that it is still the
>> primary platform for web development. Linux is *not* the "native platform for PHP
>> development".
>>
>> In fact, I would almost bet there is more PHP *development* done on Windows, even
>> though *deployment* is done on *nix. Windows is, after all, the predominant system
>> on the desktop (where most development is done).
>
> yes, for the desktop, but not where most development is done.
>
> Maybe I confound it with the question which desktop is best for *nix development, but
> it just does not make sense develop for *nix on a MS Win desktop. You do not even
> have a decent shell. MinGW and Cygwin are not THE REAL THING.
>
> BTW I am not a MS hater, I had a Technet subscription with all MS operating systems
> when I gave courses in MS Networking / Active Directory.
> /Str.
>
>
>

Most development isn't done on a desktop? Horse Hockey! People don't
develop on servers. They may (and should) have development
environments, but like most I've seen, those are done on the same
desktop they write the code on. Some may have a separate "server", but
it generally isn't really a "server" - it's another desktop which
happens to be running Apache or something similar.

It makes perfect sense to develop PHP scripts on a Windows desktop.
There are some great IDEs available for Windows, and unless you need
some rather esoteric *nix functions, the code is 100% portable.

I do my do my development here on Windows (because I need Windows for
other things anyway) with Apache running on this system. Eclipse IDE
runs great and I can edit the files right in the local web directory.
When they are working like I want them to, I upload them to a test Linux
server for final checks. Then over to the live system.

I would suggest many people use a similar process (perhaps without the
test Linux system - it's really not necessary but I like to be careful).


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180415 is a reply to message #180413] Tue, 12 February 2013 05:23 Go to previous messageGo to next message
Cal Dershowitz is currently offline  Cal Dershowitz
Messages: 36
Registered: February 2013
Karma: 0
Member
On 02/11/2013 02:40 PM, Jerry Stuckle wrote:
> On 2/11/2013 4:29 PM, M. Strobel wrote:
>> Am 11.02.2013 20:13, schrieb Jerry Stuckle:
>>> On 2/11/2013 11:23 AM, M. Strobel wrote:
>>>> Am 11.02.2013 15:29, schrieb Jerry Stuckle:
>>>> >
>>>> > Incorrect. Linux is not the "native platform for PHP
>>>> > development". It is ONE
>>>> > platform for PHP development. PHP runs fine on Windows, also. And
>>>> > there are good
>>>> > IDE's on Windows, also.
>>>> >
>>>>
>>>> Unix/Linux is the native platform for web development, because the
>>>> first web server
>>>> was on *nix, and it is still the primary platform
>>>> (http://news.netcraft.com/).
>>>>
>>>> /Str.
>>>>
>>>
>>> It doesn't matter if the first web server was on *nix, nor that it is
>>> still the
>>> primary platform for web development. Linux is *not* the "native
>>> platform for PHP
>>> development".
>>>
>>> In fact, I would almost bet there is more PHP *development* done on
>>> Windows, even
>>> though *deployment* is done on *nix. Windows is, after all, the
>>> predominant system
>>> on the desktop (where most development is done).
>>
>> yes, for the desktop, but not where most development is done.
>>
>> Maybe I confound it with the question which desktop is best for *nix
>> development, but
>> it just does not make sense develop for *nix on a MS Win desktop. You
>> do not even
>> have a decent shell. MinGW and Cygwin are not THE REAL THING.
>>
>> BTW I am not a MS hater, I had a Technet subscription with all MS
>> operating systems
>> when I gave courses in MS Networking / Active Directory.
>> /Str.
>>
>>
>>
>
> Most development isn't done on a desktop? Horse Hockey! People don't
> develop on servers. They may (and should) have development
> environments, but like most I've seen, those are done on the same
> desktop they write the code on. Some may have a separate "server", but
> it generally isn't really a "server" - it's another desktop which
> happens to be running Apache or something similar.
>
> It makes perfect sense to develop PHP scripts on a Windows desktop.
> There are some great IDEs available for Windows, and unless you need
> some rather esoteric *nix functions, the code is 100% portable.
>
> I do my do my development here on Windows (because I need Windows for
> other things anyway) with Apache running on this system. Eclipse IDE
> runs great and I can edit the files right in the local web directory.
> When they are working like I want them to, I upload them to a test Linux
> server for final checks. Then over to the live system.
>
> I would suggest many people use a similar process (perhaps without the
> test Linux system - it's really not necessary but I like to be careful).
>
>

I'm super happy that you guys are commenting on this thread, but I won't
have that flame potential not focused on getting my bologna configured.

For the purpose of this thread, OP is developing on ubuntu and is a
native american. I'm very invested in the tool-chain of linux now, My
grandma had to pass herself off as a mexican to marry a chicago cop. Her
son, my dad, would never use linux, but made extraordinary calculation
in then-available syntaxes computing a better house, with, for example,
solar gains, referenced.

I'm gonna try to get php as a two stepper, and if I fail, I'm coming
right back here.
--
Cal
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180416 is a reply to message #180415] Tue, 12 February 2013 07:02 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 12/02/13 05:23, Cal Dershowitz wrote:

> I'm gonna try to get php as a two stepper, and if I fail, I'm coming
> right back here.

Its very simple, with a few provisos

Install apache. Get a web server running by editing te config files a
bit. Not much really.

Install PHP

you may need to adjust apache to use it, but mostly not

Install any php libraries you need to communicate with other stuff like
mysql etc.

Sometimes you need to tell PHP to use them.

then get coding.


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180417 is a reply to message #180415] Tue, 12 February 2013 08:38 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 12.02.2013 06:23, schrieb Cal Dershowitz:
> On 02/11/2013 02:40 PM, Jerry Stuckle wrote:
>> On 2/11/2013 4:29 PM, M. Strobel wrote:
>>> Am 11.02.2013 20:13, schrieb Jerry Stuckle:
>>>> On 2/11/2013 11:23 AM, M. Strobel wrote:
>>>> > Am 11.02.2013 15:29, schrieb Jerry Stuckle:
>>>> >>
>>>> >> Incorrect. Linux is not the "native platform for PHP
>>>> >> development". It is ONE
>>>> >> platform for PHP development. PHP runs fine on Windows, also. And
>>>> >> there are good
>>>> >> IDE's on Windows, also.
>>>> >>
>>>> >
>>>> > Unix/Linux is the native platform for web development, because the
>>>> > first web server
>>>> > was on *nix, and it is still the primary platform
>>>> > (http://news.netcraft.com/).
>>>> >
>>>> > /Str.
>>>> >
>>>>
>>>> It doesn't matter if the first web server was on *nix, nor that it is
>>>> still the
>>>> primary platform for web development. Linux is *not* the "native
>>>> platform for PHP
>>>> development".
>>>>
>>>> In fact, I would almost bet there is more PHP *development* done on
>>>> Windows, even
>>>> though *deployment* is done on *nix. Windows is, after all, the
>>>> predominant system
>>>> on the desktop (where most development is done).
>>>
>>> yes, for the desktop, but not where most development is done.
>>>
>>> Maybe I confound it with the question which desktop is best for *nix
>>> development, but
>>> it just does not make sense develop for *nix on a MS Win desktop. You
>>> do not even
>>> have a decent shell. MinGW and Cygwin are not THE REAL THING.
>>>
>>> BTW I am not a MS hater, I had a Technet subscription with all MS
>>> operating systems
>>> when I gave courses in MS Networking / Active Directory.
>>> /Str.
>>>
>>>
>>>
>>
>> Most development isn't done on a desktop? Horse Hockey! People don't
>> develop on servers. They may (and should) have development
>> environments, but like most I've seen, those are done on the same
>> desktop they write the code on. Some may have a separate "server", but
>> it generally isn't really a "server" - it's another desktop which
>> happens to be running Apache or something similar.
>>
>> It makes perfect sense to develop PHP scripts on a Windows desktop.
>> There are some great IDEs available for Windows, and unless you need
>> some rather esoteric *nix functions, the code is 100% portable.
>>
>> I do my do my development here on Windows (because I need Windows for
>> other things anyway) with Apache running on this system. Eclipse IDE
>> runs great and I can edit the files right in the local web directory.
>> When they are working like I want them to, I upload them to a test Linux
>> server for final checks. Then over to the live system.
>>
>> I would suggest many people use a similar process (perhaps without the
>> test Linux system - it's really not necessary but I like to be careful).
>>
>>
>
> I'm super happy that you guys are commenting on this thread, but I won't have that
> flame potential not focused on getting my bologna configured.

Flaming looks different, on Usenet. This is just an exchange of point of views.

>
> For the purpose of this thread, OP is developing on ubuntu and is a native american.
> I'm very invested in the tool-chain of linux now, My grandma had to pass herself off

That's it, the tool chain. Some say *nix is a development system by itself.

> as a mexican to marry a chicago cop. Her son, my dad, would never use linux, but made
> extraordinary calculation in then-available syntaxes computing a better house, with,
> for example, solar gains, referenced.
>
> I'm gonna try to get php as a two stepper, and if I fail, I'm coming right back here.

Just install the packages with the most generic names, and you are ready to start.
The thing is, there is more to it than just finding the right PHP functions,
everything works together: network, web server, database, file system,...

Good luck.

/Str.
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180419 is a reply to message #180410] Tue, 12 February 2013 10:12 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
On Feb 11, 8:20 pm, Cal Dershowitz <c...@example.invalid> wrote:
> On 02/11/2013 06:40 AM, Warren Post wrote:
>
>
>
>
>
>
>
>
>
>> On 02/10/2013 08:58 PM, Cal Dershowitz wrote:
>>> The tutorial I looked at wants me to install XAMPP.  Is that the best
>>> idea for getting a php development environment squared away given that
>>> this
>
>>> $ uname -a
>>> Linux fred-desktop 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18
>>> 16:39:21 UTC 2012 i686 athlon i386 GNU/Linux
>
>>> is my platform?
>
>> I have a strong preference for using my distro's packages when available
>> rather than 3rd party products. In your case, that would be Ubuntu's
>> Apache, either MySQL or MariaDB, and PHP, installed and tested in that
>> order. This combination is called LAMP.
>
>> I haven't had opportunity to set up a LAMP server on Ubuntu, but perhaps
>> the notes I took when doing it on Mandriva will help you get going:
>
>> http://my.opera.com/wpost/blog/index.dml/tag/LAMP
>
> Thx all for responses.  The tutorial I looked at talked of XAAMP, where
> I was basically-ignorant of what the acronym might mean.

Ahh well I have a tip to help you here. There's this thing called
Google. If you search for XAAMP, it will helpfully tell you that it
searched instead for XAMPP and on the first page of results, it will
say:
"XAMPP is an integrated server package of Apache, mySQL, PHP and Perl
(the AMPP in XAMPP) that all run from a removable drive."
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180420 is a reply to message #180410] Tue, 12 February 2013 13:42 Go to previous messageGo to next message
Warren Post is currently offline  Warren Post
Messages: 2
Registered: February 2013
Karma: 0
Junior Member
On 02/11/2013 02:20 PM, Cal Dershowitz wrote:
> The tutorial I looked at talked of XAAMP, where I was basically-ignorant
> of what the acronym might mean.
>
> http://my.opera.com/wpost/blog/install-php
>
> So I think I need the AMP part. I guess I'm assuming that the L was for
> Linux.

Correct: Linux, Apache, MySQL, PHP = LAMP. Sorry for not making that
explicit.

> As I look at Apache in the synaptic package manager, I see 200
> choices again.
>
> You'd think that someone would have rolled the process togther a bit, as
> many times as it has to have been done.

Most Linux distros that try to be newbie friendly do, called a
metapackage. I'm not on an Ubuntu box to check what it's called there,
but FWIW on Mageia its called task-lamp.

--
Warren Post
http://my.opera.com/wpost/
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180421 is a reply to message #180411] Tue, 12 February 2013 13:50 Go to previous messageGo to next message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma: 0
Senior Member
On Mon, 11 Feb 2013 22:29:42 +0100, M. Strobel wrote:

> Am 11.02.2013 20:13, schrieb Jerry Stuckle:
>
>> On 2/11/2013 11:23 AM, M. Strobel wrote:
>>
>>> Am 11.02.2013 15:29, schrieb Jerry Stuckle:
>>>
>>>> Incorrect. Linux is not the "native platform for PHP development".
>>>> It is ONE platform for PHP development. PHP runs fine on Windows,
>>>> also. And there are good IDE's on Windows, also.
>>>
>>>
>>> Unix/Linux is the native platform for web development, because the
>>> first web server was on *nix, and it is still the primary platform
>>> (http://news.netcraft.com/).
>>>
>>> /Str.
>>
>>
>> It doesn't matter if the first web server was on *nix, nor that it is
>> still the primary platform for web development. Linux is *not* the
>> "native platform for PHP development".
>>
>> In fact, I would almost bet there is more PHP *development* done on
>> Windows, even though *deployment* is done on *nix. Windows is, after
>> all, the predominant system on the desktop (where most development is
>> done).
>
> yes, for the desktop, but not where most development is done.
>
> Maybe I confound it with the question which desktop is best for *nix
> development, but it just does not make sense develop for *nix on a MS
> Win desktop. You do not even have a decent shell. MinGW and Cygwin are
> not THE REAL THING.

I am not sure how this matters, since 99.9% of development doesn't
even touch a shell, and wouldn't need the facilities of even those
(MinGW/Cygwin) anyway. An IDE works with files, it may compile things,
it probably does some socket stuff connecting to a versioning system
or source repository, but all the capacities of the programs being
developed depend on the capacities of the languages that they're built
in, and all stuff outside that can easily be provided by the IDE itself.
(EG: Who cares if you've got a posix grep utility around if your IDE
would be built with a regexp library bound in anyway?)

--
40. I will be neither chivalrous nor sporting. If I have an unstoppable
superweapon, I will use it as early and as often as possible instead
of keeping it in reserve.
--Peter Anspach's list of things to do as an Evil Overlord
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180422 is a reply to message #180417] Tue, 12 February 2013 13:54 Go to previous messageGo to next message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma: 0
Senior Member
On Tue, 12 Feb 2013 09:38:45 +0100, M. Strobel wrote:

> Am 12.02.2013 06:23, schrieb Cal Dershowitz:
>
>> I'm super happy that you guys are commenting on this thread, but I
>> won't have that flame potential not focused on getting my bologna
>> configured.
>
> Flaming looks different, on Usenet. This is just an exchange of point
> of views.

Flaming on USENET can frequently be noted to involve sexual tastes
and diagnosises of genetic disorders due to too-close parents. We'll
probably get there in time. (:

--
Mares eat oats, and does eat oats, and little lambs eat ivy,
A kid will eat ivy too, wouldn't you?
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180423 is a reply to message #180415] Tue, 12 February 2013 14:09 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 2/12/2013 12:23 AM, Cal Dershowitz wrote:
> On 02/11/2013 02:40 PM, Jerry Stuckle wrote:
>> On 2/11/2013 4:29 PM, M. Strobel wrote:
>>> Am 11.02.2013 20:13, schrieb Jerry Stuckle:
>>>> On 2/11/2013 11:23 AM, M. Strobel wrote:
>>>> > Am 11.02.2013 15:29, schrieb Jerry Stuckle:
>>>> >>
>>>> >> Incorrect. Linux is not the "native platform for PHP
>>>> >> development". It is ONE
>>>> >> platform for PHP development. PHP runs fine on Windows, also. And
>>>> >> there are good
>>>> >> IDE's on Windows, also.
>>>> >>
>>>> >
>>>> > Unix/Linux is the native platform for web development, because the
>>>> > first web server
>>>> > was on *nix, and it is still the primary platform
>>>> > (http://news.netcraft.com/).
>>>> >
>>>> > /Str.
>>>> >
>>>>
>>>> It doesn't matter if the first web server was on *nix, nor that it is
>>>> still the
>>>> primary platform for web development. Linux is *not* the "native
>>>> platform for PHP
>>>> development".
>>>>
>>>> In fact, I would almost bet there is more PHP *development* done on
>>>> Windows, even
>>>> though *deployment* is done on *nix. Windows is, after all, the
>>>> predominant system
>>>> on the desktop (where most development is done).
>>>
>>> yes, for the desktop, but not where most development is done.
>>>
>>> Maybe I confound it with the question which desktop is best for *nix
>>> development, but
>>> it just does not make sense develop for *nix on a MS Win desktop. You
>>> do not even
>>> have a decent shell. MinGW and Cygwin are not THE REAL THING.
>>>
>>> BTW I am not a MS hater, I had a Technet subscription with all MS
>>> operating systems
>>> when I gave courses in MS Networking / Active Directory.
>>> /Str.
>>>
>>>
>>>
>>
>> Most development isn't done on a desktop? Horse Hockey! People don't
>> develop on servers. They may (and should) have development
>> environments, but like most I've seen, those are done on the same
>> desktop they write the code on. Some may have a separate "server", but
>> it generally isn't really a "server" - it's another desktop which
>> happens to be running Apache or something similar.
>>
>> It makes perfect sense to develop PHP scripts on a Windows desktop.
>> There are some great IDEs available for Windows, and unless you need
>> some rather esoteric *nix functions, the code is 100% portable.
>>
>> I do my do my development here on Windows (because I need Windows for
>> other things anyway) with Apache running on this system. Eclipse IDE
>> runs great and I can edit the files right in the local web directory.
>> When they are working like I want them to, I upload them to a test Linux
>> server for final checks. Then over to the live system.
>>
>> I would suggest many people use a similar process (perhaps without the
>> test Linux system - it's really not necessary but I like to be careful).
>>
>>
>
> I'm super happy that you guys are commenting on this thread, but I won't
> have that flame potential not focused on getting my bologna configured.
>
> For the purpose of this thread, OP is developing on ubuntu and is a
> native american. I'm very invested in the tool-chain of linux now, My
> grandma had to pass herself off as a mexican to marry a chicago cop. Her
> son, my dad, would never use linux, but made extraordinary calculation
> in then-available syntaxes computing a better house, with, for example,
> solar gains, referenced.
>
> I'm gonna try to get php as a two stepper, and if I fail, I'm coming
> right back here.

I think the easiest way for you to install PHP would be to use the
ubuntu package manager. I understand ubuntu isn't much different than
debian (which is what I use), and it will preconfigure a working system
for you. It's also easy to change the configuration.

And no, we aren't flaming. Just having a difference of opinion :).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180424 is a reply to message #180420] Tue, 12 February 2013 14:27 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 12/02/13 13:42, Warren Post wrote:
> On 02/11/2013 02:20 PM, Cal Dershowitz wrote:
>> The tutorial I looked at talked of XAAMP, where I was basically-ignorant
>> of what the acronym might mean.
>>
>> http://my.opera.com/wpost/blog/install-php
>>
>> So I think I need the AMP part. I guess I'm assuming that the L was for
>> Linux.
>
> Correct: Linux, Apache, MySQL, PHP = LAMP. Sorry for not making that
> explicit.
>
>> As I look at Apache in the synaptic package manager, I see 200
>> choices again.
>>
>> You'd think that someone would have rolled the process togther a bit, as
>> many times as it has to have been done.
>
> Most Linux distros that try to be newbie friendly do, called a
> metapackage. I'm not on an Ubuntu box to check what it's called there,
> but FWIW on Mageia its called task-lamp.
>
All here by the looks of it

https://help.ubuntu.com/community/ApacheMySQLPHP



--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180425 is a reply to message #180421] Tue, 12 February 2013 14:28 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 12/02/13 13:50, Peter H. Coffin wrote:
> On Mon, 11 Feb 2013 22:29:42 +0100, M. Strobel wrote:
>
>> Am 11.02.2013 20:13, schrieb Jerry Stuckle:
>>
>>> On 2/11/2013 11:23 AM, M. Strobel wrote:
>>>
>>>> Am 11.02.2013 15:29, schrieb Jerry Stuckle:
>>>>
>>>> > Incorrect. Linux is not the "native platform for PHP development".
>>>> > It is ONE platform for PHP development. PHP runs fine on Windows,
>>>> > also. And there are good IDE's on Windows, also.
>>>>
>>>>
>>>> Unix/Linux is the native platform for web development, because the
>>>> first web server was on *nix, and it is still the primary platform
>>>> (http://news.netcraft.com/).
>>>>
>>>> /Str.
>>>
>>>
>>> It doesn't matter if the first web server was on *nix, nor that it is
>>> still the primary platform for web development. Linux is *not* the
>>> "native platform for PHP development".
>>>
>>> In fact, I would almost bet there is more PHP *development* done on
>>> Windows, even though *deployment* is done on *nix. Windows is, after
>>> all, the predominant system on the desktop (where most development is
>>> done).
>>
>> yes, for the desktop, but not where most development is done.
>>
>> Maybe I confound it with the question which desktop is best for *nix
>> development, but it just does not make sense develop for *nix on a MS
>> Win desktop. You do not even have a decent shell. MinGW and Cygwin are
>> not THE REAL THING.
>
> I am not sure how this matters, since 99.9% of development doesn't
> even touch a shell, and wouldn't need the facilities of even those
> (MinGW/Cygwin) anyway. An IDE works with files, it may compile things,
> it probably does some socket stuff connecting to a versioning system
> or source repository, but all the capacities of the programs being
> developed depend on the capacities of the languages that they're built
> in, and all stuff outside that can easily be provided by the IDE itself.
> (EG: Who cares if you've got a posix grep utility around if your IDE
> would be built with a regexp library bound in anyway?)
>
agreed. I used to do it with just a decent editor.

Till Linux got good enough to ditch windows 98...




--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180426 is a reply to message #180421] Tue, 12 February 2013 14:29 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 12.02.2013 14:50, schrieb Peter H. Coffin:
> On Mon, 11 Feb 2013 22:29:42 +0100, M. Strobel wrote:
>
>> Am 11.02.2013 20:13, schrieb Jerry Stuckle:
>>
>>> On 2/11/2013 11:23 AM, M. Strobel wrote:
>>>
>>>> Am 11.02.2013 15:29, schrieb Jerry Stuckle:
>>>>
>>>> > Incorrect. Linux is not the "native platform for PHP development".
>>>> > It is ONE platform for PHP development. PHP runs fine on Windows,
>>>> > also. And there are good IDE's on Windows, also.
>>>>
>>>>
>>>> Unix/Linux is the native platform for web development, because the
>>>> first web server was on *nix, and it is still the primary platform
>>>> (http://news.netcraft.com/).
>>>>
>>>> /Str.
>>>
>>>
>>> It doesn't matter if the first web server was on *nix, nor that it is
>>> still the primary platform for web development. Linux is *not* the
>>> "native platform for PHP development".
>>>
>>> In fact, I would almost bet there is more PHP *development* done on
>>> Windows, even though *deployment* is done on *nix. Windows is, after
>>> all, the predominant system on the desktop (where most development is
>>> done).
>>
>> yes, for the desktop, but not where most development is done.
>>
>> Maybe I confound it with the question which desktop is best for *nix
>> development, but it just does not make sense develop for *nix on a MS
>> Win desktop. You do not even have a decent shell. MinGW and Cygwin are
>> not THE REAL THING.
>
> I am not sure how this matters, since 99.9% of development doesn't
> even touch a shell, and wouldn't need the facilities of even those
> (MinGW/Cygwin) anyway. An IDE works with files, it may compile things,
> it probably does some socket stuff connecting to a versioning system
> or source repository, but all the capacities of the programs being
> developed depend on the capacities of the languages that they're built
> in, and all stuff outside that can easily be provided by the IDE itself.
> (EG: Who cares if you've got a posix grep utility around if your IDE
> would be built with a regexp library bound in anyway?)
>

Then it looks like I am doing something completely wrong.

I have to: write helper scripts, distribute them on my servers into the search path,
version them, pump data out one database piping via ssh to remote servers, automate
remote server setup and management, set up remote versioning repos, testing PHP
snippets because of version differences and fine tuning, test HTML5 features and
javascript in browser versions, write DB consistency checks, ... and yes, brute force
grep through everything for refactoring.

It really helps to work within the same OS family.
/Str.
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180427 is a reply to message #180424] Wed, 13 February 2013 04:09 Go to previous messageGo to next message
Cal Dershowitz is currently offline  Cal Dershowitz
Messages: 36
Registered: February 2013
Karma: 0
Member
On 02/12/2013 07:27 AM, The Natural Philosopher wrote:

> All here by the looks of it
>
> https://help.ubuntu.com/community/ApacheMySQLPHP
>
>
>

Thanks all for comments. I got as far in the process as to have a
localhost that shows up in a browser and try to write test.php, and I
don't want to get too far ahead of myself with enabling permissions.

$ cat > test.php
bash: test.php: Permission denied
$ pwd
/var/www
$ cd ..
$ ls -l
total 48
drwxr-xr-x 2 root root 4096 Feb 1 17:18 backups
drwxr-xr-x 18 root root 4096 Feb 12 20:06 cache
drwxrwsrwt 2 root whoopsie 4096 Dec 13 07:35 crash
drwxr-xr-x 2 root root 4096 Apr 23 2012 games
drwxr-xr-x 66 root root 4096 Feb 12 20:07 lib
drwxrwsr-x 2 root staff 4096 Apr 19 2012 local
lrwxrwxrwx 1 root root 9 Jan 23 02:33 lock -> /run/lock
drwxr-xr-x 19 root root 4096 Feb 12 20:07 log
drwxrwsr-x 2 root mail 4096 Apr 23 2012 mail
drwxr-xr-x 2 root root 4096 Apr 23 2012 opt
lrwxrwxrwx 1 root root 4 Jan 23 02:33 run -> /run
drwxr-xr-x 8 root root 4096 Apr 23 2012 spool
drwxrwxrwt 2 root root 4096 Feb 12 20:02 tmp
drwxr-xr-x 2 root root 4096 Feb 12 20:08 www
$

Without any better notion, I would simply chmod a +w here for www, but
I'd first like to ask if that's a good idea, as sometimes I've found
that when I lack permission to do something, that it's more like keeping
me from shooting myself in the foot.

What would you do now?
--
Cal
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180429 is a reply to message #180427] Wed, 13 February 2013 11:14 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 2/12/2013 11:09 PM, Cal Dershowitz wrote:
> On 02/12/2013 07:27 AM, The Natural Philosopher wrote:
>
>> All here by the looks of it
>>
>> https://help.ubuntu.com/community/ApacheMySQLPHP
>>
>>
>>
>
> Thanks all for comments. I got as far in the process as to have a
> localhost that shows up in a browser and try to write test.php, and I
> don't want to get too far ahead of myself with enabling permissions.
>
> $ cat > test.php
> bash: test.php: Permission denied
> $ pwd
> /var/www
> $ cd ..
> $ ls -l
> total 48
> drwxr-xr-x 2 root root 4096 Feb 1 17:18 backups
> drwxr-xr-x 18 root root 4096 Feb 12 20:06 cache
> drwxrwsrwt 2 root whoopsie 4096 Dec 13 07:35 crash
> drwxr-xr-x 2 root root 4096 Apr 23 2012 games
> drwxr-xr-x 66 root root 4096 Feb 12 20:07 lib
> drwxrwsr-x 2 root staff 4096 Apr 19 2012 local
> lrwxrwxrwx 1 root root 9 Jan 23 02:33 lock -> /run/lock
> drwxr-xr-x 19 root root 4096 Feb 12 20:07 log
> drwxrwsr-x 2 root mail 4096 Apr 23 2012 mail
> drwxr-xr-x 2 root root 4096 Apr 23 2012 opt
> lrwxrwxrwx 1 root root 4 Jan 23 02:33 run -> /run
> drwxr-xr-x 8 root root 4096 Apr 23 2012 spool
> drwxrwxrwt 2 root root 4096 Feb 12 20:02 tmp
> drwxr-xr-x 2 root root 4096 Feb 12 20:08 www
> $
>
> Without any better notion, I would simply chmod a +w here for www, but
> I'd first like to ask if that's a good idea, as sometimes I've found
> that when I lack permission to do something, that it's more like keeping
> me from shooting myself in the foot.
>
> What would you do now?

I wouldn't be running as root. You should almost never use root as a
user account. Rather, run as a user account with the appropriate
permissions. And set your directories up similarly.

But Linux permissions are off topic here. You should be asking in an
ubuntu group - where you'll get good advice for your OS-related questions.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180430 is a reply to message #180427] Wed, 13 February 2013 19:35 Go to previous messageGo to next message
Allodoxaphobia is currently offline  Allodoxaphobia
Messages: 21
Registered: September 2010
Karma: 0
Junior Member
On Tue, 12 Feb 2013 21:09:49 -0700, Cal Dershowitz wrote:
> On 02/12/2013 07:27 AM, The Natural Philosopher wrote:
>
>> All here by the looks of it
>>
>> https://help.ubuntu.com/community/ApacheMySQLPHP
>
> Thanks all for comments. I got as far in the process as to have a
> localhost that shows up in a browser and try to write test.php, and I
> don't want to get too far ahead of myself with enabling permissions.
>
> $ cat > test.php
> bash: test.php: Permission denied

errr... uhhhh.. chmod executable?

Jonesy
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180431 is a reply to message #180427] Wed, 13 February 2013 23:40 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 13/02/13 04:09, Cal Dershowitz wrote:
> On 02/12/2013 07:27 AM, The Natural Philosopher wrote:
>
>> All here by the looks of it
>>
>> https://help.ubuntu.com/community/ApacheMySQLPHP
>>
>>
>>
>
> Thanks all for comments. I got as far in the process as to have a
> localhost that shows up in a browser and try to write test.php, and I
> don't want to get too far ahead of myself with enabling permissions.
>
> $ cat > test.php
> bash: test.php: Permission denied
> $ pwd
> /var/www
> $ cd ..
> $ ls -l
> total 48
> drwxr-xr-x 2 root root 4096 Feb 1 17:18 backups
> drwxr-xr-x 18 root root 4096 Feb 12 20:06 cache
> drwxrwsrwt 2 root whoopsie 4096 Dec 13 07:35 crash
> drwxr-xr-x 2 root root 4096 Apr 23 2012 games
> drwxr-xr-x 66 root root 4096 Feb 12 20:07 lib
> drwxrwsr-x 2 root staff 4096 Apr 19 2012 local
> lrwxrwxrwx 1 root root 9 Jan 23 02:33 lock -> /run/lock
> drwxr-xr-x 19 root root 4096 Feb 12 20:07 log
> drwxrwsr-x 2 root mail 4096 Apr 23 2012 mail
> drwxr-xr-x 2 root root 4096 Apr 23 2012 opt
> lrwxrwxrwx 1 root root 4 Jan 23 02:33 run -> /run
> drwxr-xr-x 8 root root 4096 Apr 23 2012 spool
> drwxrwxrwt 2 root root 4096 Feb 12 20:02 tmp
> drwxr-xr-x 2 root root 4096 Feb 12 20:08 www
> $
>
> Without any better notion, I would simply chmod a +w here for www, but
> I'd first like to ask if that's a good idea, as sometimes I've found
> that when I lack permission to do something, that it's more like keeping
> me from shooting myself in the foot.
>
> What would you do now?
I would make www owned by (IIRC) www-data or whatever apache runs under,
and group staff and leave the permissions alone.

If that is felt to be a bit lax there are other arrangements involving
sticky bits that can ensure that what goes in there gets allocated to
the right group.

For a nasty hack for testing and getting stuff working chmod 777 the
directory at least. But don't do that on a publicly
visible server.

It pays to understand the permissions system on *nix properly,and use it
as another line of defence against hackers.


#

--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180432 is a reply to message #180431] Thu, 14 February 2013 06:48 Go to previous messageGo to next message
Cal Dershowitz is currently offline  Cal Dershowitz
Messages: 36
Registered: February 2013
Karma: 0
Member
On 02/13/2013 04:40 PM, The Natural Philosopher wrote:
> On 13/02/13 04:09, Cal Dershowitz wrote:
>> On 02/12/2013 07:27 AM, The Natural Philosopher wrote:
>>
>>> All here by the looks of it
>>>
>>> https://help.ubuntu.com/community/ApacheMySQLPHP
>>>
>>>
>>>
>>
>> Thanks all for comments. I got as far in the process as to have a
>> localhost that shows up in a browser and try to write test.php, and I
>> don't want to get too far ahead of myself with enabling permissions.
>>
>> $ cat > test.php
>> bash: test.php: Permission denied
>> $ pwd
>> /var/www
>> $ cd ..
>> $ ls -l
>> total 48
>> drwxr-xr-x 2 root root 4096 Feb 1 17:18 backups
>> drwxr-xr-x 18 root root 4096 Feb 12 20:06 cache
>> drwxrwsrwt 2 root whoopsie 4096 Dec 13 07:35 crash
>> drwxr-xr-x 2 root root 4096 Apr 23 2012 games
>> drwxr-xr-x 66 root root 4096 Feb 12 20:07 lib
>> drwxrwsr-x 2 root staff 4096 Apr 19 2012 local
>> lrwxrwxrwx 1 root root 9 Jan 23 02:33 lock -> /run/lock
>> drwxr-xr-x 19 root root 4096 Feb 12 20:07 log
>> drwxrwsr-x 2 root mail 4096 Apr 23 2012 mail
>> drwxr-xr-x 2 root root 4096 Apr 23 2012 opt
>> lrwxrwxrwx 1 root root 4 Jan 23 02:33 run -> /run
>> drwxr-xr-x 8 root root 4096 Apr 23 2012 spool
>> drwxrwxrwt 2 root root 4096 Feb 12 20:02 tmp
>> drwxr-xr-x 2 root root 4096 Feb 12 20:08 www
>> $
>>
>> Without any better notion, I would simply chmod a +w here for www, but
>> I'd first like to ask if that's a good idea, as sometimes I've found
>> that when I lack permission to do something, that it's more like keeping
>> me from shooting myself in the foot.
>>
>> What would you do now?
> I would make www owned by (IIRC) www-data or whatever apache runs under,
> and group staff and leave the permissions alone.

Can you elaborate?
>
> If that is felt to be a bit lax there are other arrangements involving
> sticky bits that can ensure that what goes in there gets allocated to
> the right group.
>
> For a nasty hack for testing and getting stuff working chmod 777 the
> directory at least. But don't do that on a publicly
> visible server.
>
> It pays to understand the permissions system on *nix properly,and use it
> as another line of defence against hackers.
>
>
> #
>


Thank you, NP. "Dirty" is particularly-encouraging as a tactic, since
it really is only me here, on an ancient machine, trying to make
something happen.

I've been x-posting here for a bit and even cross-threading, not out of
malice for the original topicalit of forums, but for the direction a
thread takes.
$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
....
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
syslog:x:101:103::/home/syslog:/bin/false
messagebus:x:102:105::/var/run/dbus:/bin/false
colord:x:103:108:colord colour management
daemon,,,:/var/lib/colord:/bin/false
lightdm:x:104:111:Light Display Manager:/var/lib/lightdm:/bin/false
whoopsie:x:105:114::/nonexistent:/bin/false
avahi-autoipd:x:106:117:Avahi autoip
daemon,,,:/var/lib/avahi-autoipd:/bin/false
avahi:x:107:118:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false
usbmux:x:108:46:usbmux daemon,,,:/home/usbmux:/bin/false
kernoops:x:109:65534:Kernel Oops Tracking Daemon,,,:/:/bin/false
pulse:x:110:119:PulseAudio daemon,,,:/var/run/pulse:/bin/false
rtkit:x:111:122:RealtimeKit,,,:/proc:/bin/false
speech-dispatcher:x:112:29:Speech
Dispatcher,,,:/var/run/speech-dispatcher:/bin/sh
hplip:x:113:7:HPLIP system user,,,:/var/run/hplip:/bin/false
saned:x:114:123::/home/saned:/bin/false
fred:x:1000:1000:fred,,,:/home/fred:/bin/bash
landscape:x:115:125::/var/lib/landscape:/bin/false
sshd:x:116:65534::/var/run/sshd:/usr/sbin/nologin
mysql:x:117:126:MySQL Server,,,:/nonexistent:/bin/false
$


Q,7) Are these the users of my ubuntu system?

After the ellipses, I think all of that got added as I did a LAMP
install. Now I have a quiver full of questions.

Q1) Now that I have shown /etc/passwd on-line, have I laid out my cards
to hackers who just have a lot of time their hands, be bored and want to
do something interesting. Be aware that my machine and website might
total one hundred bucks in assets.

Q2) Do I want to create a group that comprehends all these differing
agents in apache?

You know what, now that I think about it, all these questions are right
in the strike zone for c.l.php and a.o.l.ubuntu.

Thanks for your comment and cheers,
--
Cal
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180439 is a reply to message #180432] Thu, 14 February 2013 16:15 Go to previous messageGo to next message
Kim Andr Aker is currently offline  Kim Andr Aker
Messages: 17
Registered: September 2010
Karma: 0
Junior Member
På Thu, 14 Feb 2013 07:48:44 +0100, skrev Cal Dershowitz
<cal(at)example(dot)invalid>:

> On 02/13/2013 04:40 PM, The Natural Philosopher wrote:
>> On 13/02/13 04:09, Cal Dershowitz wrote:
>>> On 02/12/2013 07:27 AM, The Natural Philosopher wrote:
>>>
>>>> All here by the looks of it
>>>>
>>>> https://help.ubuntu.com/community/ApacheMySQLPHP
>>>>
>>>>
>>>>
>>>
>>> Thanks all for comments. I got as far in the process as to have a
>>> localhost that shows up in a browser and try to write test.php, and I
>>> don't want to get too far ahead of myself with enabling permissions.
>>>
>>> $ cat > test.php
>>> bash: test.php: Permission denied
>>> $ pwd
>>> /var/www
>>> $ cd ..
>>> $ ls -l
>>> total 48
>>> drwxr-xr-x 2 root root 4096 Feb 1 17:18 backups
>>> drwxr-xr-x 18 root root 4096 Feb 12 20:06 cache
>>> drwxrwsrwt 2 root whoopsie 4096 Dec 13 07:35 crash
>>> drwxr-xr-x 2 root root 4096 Apr 23 2012 games
>>> drwxr-xr-x 66 root root 4096 Feb 12 20:07 lib
>>> drwxrwsr-x 2 root staff 4096 Apr 19 2012 local
>>> lrwxrwxrwx 1 root root 9 Jan 23 02:33 lock -> /run/lock
>>> drwxr-xr-x 19 root root 4096 Feb 12 20:07 log
>>> drwxrwsr-x 2 root mail 4096 Apr 23 2012 mail
>>> drwxr-xr-x 2 root root 4096 Apr 23 2012 opt
>>> lrwxrwxrwx 1 root root 4 Jan 23 02:33 run -> /run
>>> drwxr-xr-x 8 root root 4096 Apr 23 2012 spool
>>> drwxrwxrwt 2 root root 4096 Feb 12 20:02 tmp
>>> drwxr-xr-x 2 root root 4096 Feb 12 20:08 www
>>> $
>>>
>>> Without any better notion, I would simply chmod a +w here for www, but
>>> I'd first like to ask if that's a good idea, as sometimes I've found
>>> that when I lack permission to do something, that it's more like
>>> keeping
>>> me from shooting myself in the foot.
>>>
>>> What would you do now?
>> I would make www owned by (IIRC) www-data or whatever apache runs under,
>> and group staff and leave the permissions alone.
>
> Can you elaborate?

Your /var/www folder is owned by the root user, and the permissions are
set to only allow the root user to create and write to files in that
folder.

From your list of users, I'd say the www-data user is the right one for
this scenario. Just run the following command:

sudo chown -R www-data:www-data /var/www

This will change the owner (chown) of the /var/www folder to the
"www-data" user (and the "www-data" group), and all files and folders
within it (-R = recursively). The sudo command is used to run the chown
command with elevated administrator privileges (ie. as the root user). You
may have to provide a password to run that command, though. If you're
already running the command as the root user, you don't need to run it
through "sudo".

The other privileges on the files inside /var/www (read/write/execute) can
stay as they are (no need to use the "chmod" command).

> [snip]
>
> Q,7) Are these the users of my ubuntu system?
>
> After the ellipses, I think all of that got added as I did a LAMP
> install. Now I have a quiver full of questions.

Yes, these are all users of your Ubuntu system, most of these are created
and used for various background services, especially those with a
userid/uid lower than 1000 - each line is in the following format (each
field is separated by ":" - a colon):
username:x:userid:groupid:real name (or description):homedir:shell

http://en.wikipedia.org/wiki/Passwd_(file)

The www-data user and group is the most common user/group created when
installing Apache2 on Ubuntu and Debian systems.

> Q1) Now that I have shown /etc/passwd on-line, have I laid out my cards
> to hackers who just have a lot of time their hands, be bored and want to
> do something interesting. Be aware that my machine and website might
> total one hundred bucks in assets.

The only "useful" information contained in the /etc/passwd file is mainly
the usernames - all the rest is mostly useless to outside attackers (the
password is not revealed in this file, and the homedir and shell paths are
only somewhat useful once the user has already gotten inside). It may
provide a starting point for brute-force hacking, though, but then they'd
also have to know the IP address of your server as well.

> Q2) Do I want to create a group that comprehends all these differing
> agents in apache?

All websites served by Apache run under the user that has been defined for
Apache (usually the user "www-data" and the group "www-data" - this can be
changed in the config files for Apache, though).

--
Kim André Akerø
- kimandre(at)NOSPAMbetadome(dot)com
(remove NOSPAM to contact me directly)
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180448 is a reply to message #180426] Sun, 17 February 2013 07:48 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
M. Strobel, 2013-02-12 15:29:

> Am 12.02.2013 14:50, schrieb Peter H. Coffin:
>> On Mon, 11 Feb 2013 22:29:42 +0100, M. Strobel wrote:
[...]
>>> Maybe I confound it with the question which desktop is best for *nix
>>> development, but it just does not make sense develop for *nix on a MS
>>> Win desktop. You do not even have a decent shell. MinGW and Cygwin are
>>> not THE REAL THING.
>>
>> I am not sure how this matters, since 99.9% of development doesn't
>> even touch a shell, and wouldn't need the facilities of even those
>> (MinGW/Cygwin) anyway. An IDE works with files, it may compile things,
>> it probably does some socket stuff connecting to a versioning system
>> or source repository, but all the capacities of the programs being
>> developed depend on the capacities of the languages that they're built
>> in, and all stuff outside that can easily be provided by the IDE itself.
>> (EG: Who cares if you've got a posix grep utility around if your IDE
>> would be built with a regexp library bound in anyway?)
>>
>
> Then it looks like I am doing something completely wrong.
>
> I have to: write helper scripts, distribute them on my servers into the search path,
> version them, pump data out one database piping via ssh to remote servers, automate
> remote server setup and management, set up remote versioning repos, testing PHP
> snippets because of version differences and fine tuning, test HTML5 features and
> javascript in browser versions, write DB consistency checks, ... and yes, brute force
> grep through everything for refactoring.
>
> It really helps to work within the same OS family.

In *this* case - yes, for you.

But "PHP development" does not necessarily involve "helper scripts",
"piping via ssh to remote servers", "automate remote server setup and
management" etc. This is just a use case - and even a rare one compared
to the number of existing PHP installations and what they are used for.

There are a lot of PHP based applications which only need PHP itself and
probably a database like MySQL - and run fine on a Windows based system
as well.

Therefore i would not say that Linux is the "native" platform for PHP.
Apache is also not the "native" platform for web servers - other systems
like nginx or IIS exist and are used as well.

Of course - depending on what you want to do, it is important to have
the same environment for development as for production (same web server,
same libraries etc.). But this may also just be "Apache", "MySQL", "PHP"
- and nothing more.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180460 is a reply to message #180423] Tue, 19 February 2013 08:56 Go to previous messageGo to next message
Cal Dershowitz is currently offline  Cal Dershowitz
Messages: 36
Registered: February 2013
Karma: 0
Member
On 02/12/2013 06:09 AM, Jerry Stuckle wrote:

>
> I think the easiest way for you to install PHP would be to use the
> ubuntu package manager. I understand ubuntu isn't much different than
> debian (which is what I use), and it will preconfigure a working system
> for you. It's also easy to change the configuration.
>
> And no, we aren't flaming. Just having a difference of opinion :).
>

Jerry, I'm glad you didn't, because I'm not quite there, and it would be
hard to double back if everyone knew this subthread was engulfed in
silliness.

It seems people have differing means of accomplishing what I have set
forth to do here, each catering to their own apache architecture needs.

IMO, the hands-down winner for how to get a LAMP capability on ubuntu
was supplied most the way with a one-liner by ben:

sudo apt-get install apache2 php5

Ultimately, I decided to go for a default installation, after having
taken steps in another direction. I've gone back and edited

/etc/apache2/sites-available/default

to have /var/www/
(tried /var/www as well)

restarted, yet I can't get output on this simplest of scripts
$ pwd
/var/www
$ ls -l
total 8
-rw-r--r-- 1 www-data automation 177 Feb 12 19:08 index.html
-rw-r--r-- 1 fred automation 20 Feb 18 23:02 test.php
$ cat test.php
<?php phpinfo(); ?>
$

What I get is firefox telling me that it cannot connect to the server at
localhost.

Fishing for tips.
--
Cal
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180461 is a reply to message #180448] Tue, 19 February 2013 09:19 Go to previous messageGo to next message
Cal Dershowitz is currently offline  Cal Dershowitz
Messages: 36
Registered: February 2013
Karma: 0
Member
On 02/16/2013 11:48 PM, Arno Welzel wrote:
> M. Strobel, 2013-02-12 15:29:

>> It really helps to work within the same OS family.
>
> In *this* case - yes, for you.
>
> But "PHP development" does not necessarily involve "helper scripts",
> "piping via ssh to remote servers", "automate remote server setup and
> management" etc. This is just a use case - and even a rare one compared
> to the number of existing PHP installations and what they are used for.
>
> There are a lot of PHP based applications which only need PHP itself and
> probably a database like MySQL - and run fine on a Windows based system
> as well.

Arno,

I'd like to stop you right here and ask you a question. It goes to
overall architecture.

I notice that the facebook I spend way too much time on is written in
php. Am I correct to think that the images and vids we see on fb are
accessed through being in that database?

I ask, because with my current toolchain for uploading images to the
net, I have to create a new, unique directory every time or risk that
the content simply be there for the hacking.

What I want to do is use my web domain to show photos and vids just like
any other site can. Heck even the nra can do it. This is how I promote
the projects I'm working on.
>
> Therefore i would not say that Linux is the "native" platform for PHP.
> Apache is also not the "native" platform for web servers - other systems
> like nginx or IIS exist and are used as well.
>
> Of course - depending on what you want to do, it is important to have
> the same environment for development as for production (same web server,
> same libraries etc.). But this may also just be "Apache", "MySQL", "PHP"
> - and nothing more.
>
>

Gruss aus den Staaten,
--
Cal
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180462 is a reply to message #180439] Tue, 19 February 2013 09:27 Go to previous messageGo to next message
Cal Dershowitz is currently offline  Cal Dershowitz
Messages: 36
Registered: February 2013
Karma: 0
Member
On 02/14/2013 08:15 AM, Kim André Akerø wrote:

> sudo chown -R www-data:www-data /var/www

Thx, Kim, this really helped me out of the mire, but I'm not quite
squared-away yet.
>
> This will change the owner (chown) of the /var/www folder to the
> "www-data" user (and the "www-data" group), and all files and folders
> within it (-R = recursively). The sudo command is used to run the chown
> command with elevated administrator privileges (ie. as the root user).
> You may have to provide a password to run that command, though. If
> you're already running the command as the root user, you don't need to
> run it through "sudo".
>
> The other privileges on the files inside /var/www (read/write/execute)
> can stay as they are (no need to use the "chmod" command).
>

ok. to run as a php script, a file only need to have read permission,
though, right?

snip
--
Cal
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180465 is a reply to message #180461] Tue, 19 February 2013 10:43 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Cal Dershowitz, 2013-02-19 10:19:

> On 02/16/2013 11:48 PM, Arno Welzel wrote:
>> M. Strobel, 2013-02-12 15:29:
>
>>> It really helps to work within the same OS family.
>>
>> In *this* case - yes, for you.
>>
>> But "PHP development" does not necessarily involve "helper scripts",
>> "piping via ssh to remote servers", "automate remote server setup and
>> management" etc. This is just a use case - and even a rare one compared
>> to the number of existing PHP installations and what they are used for.
>>
>> There are a lot of PHP based applications which only need PHP itself and
>> probably a database like MySQL - and run fine on a Windows based system
>> as well.
>
> Arno,
>
> I'd like to stop you right here and ask you a question. It goes to
> overall architecture.
>
> I notice that the facebook I spend way too much time on is written in
> php. Am I correct to think that the images and vids we see on fb are
> accessed through being in that database?

Maybe - but this is pure speculation, since i don't know how Facebook
implemented the image storage. It may also be, that images are stored as
files in a directory which is not accessible to the public and
develivered using scripts which fetch the files.

> I ask, because with my current toolchain for uploading images to the
> net, I have to create a new, unique directory every time or risk that
> the content simply be there for the hacking.
>
> What I want to do is use my web domain to show photos and vids just like
> any other site can. Heck even the nra can do it. This is how I promote
> the projects I'm working on.

And what exactly is your problem? What do you mean by "risk that the
content simply be there for the hacking"?


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180466 is a reply to message #180462] Tue, 19 February 2013 10:44 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Cal Dershowitz, 2013-02-19 10:27:

> On 02/14/2013 08:15 AM, Kim André Akerø wrote:
>
>> sudo chown -R www-data:www-data /var/www
>
> Thx, Kim, this really helped me out of the mire, but I'm not quite
> squared-away yet.
>>
>> This will change the owner (chown) of the /var/www folder to the
>> "www-data" user (and the "www-data" group), and all files and folders
>> within it (-R = recursively). The sudo command is used to run the chown
>> command with elevated administrator privileges (ie. as the root user).
>> You may have to provide a password to run that command, though. If
>> you're already running the command as the root user, you don't need to
>> run it through "sudo".
>>
>> The other privileges on the files inside /var/www (read/write/execute)
>> can stay as they are (no need to use the "chmod" command).
>>
>
> ok. to run as a php script, a file only need to have read permission,
> though, right?

Yes - since you do not run a PHP script directly but use the PHP
interpeter to do this for you, either with a PHP module in your
Webserver or an external handler.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180470 is a reply to message #180460] Tue, 19 February 2013 12:12 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 19/02/13 08:56, Cal Dershowitz wrote:
> On 02/12/2013 06:09 AM, Jerry Stuckle wrote:
>
>>
>> I think the easiest way for you to install PHP would be to use the
>> ubuntu package manager. I understand ubuntu isn't much different than
>> debian (which is what I use), and it will preconfigure a working system
>> for you. It's also easy to change the configuration.
>>
>> And no, we aren't flaming. Just having a difference of opinion :).
>>
>
> Jerry, I'm glad you didn't, because I'm not quite there, and it would be
> hard to double back if everyone knew this subthread was engulfed in
> silliness.
>
> It seems people have differing means of accomplishing what I have set
> forth to do here, each catering to their own apache architecture needs.
>
> IMO, the hands-down winner for how to get a LAMP capability on ubuntu
> was supplied most the way with a one-liner by ben:
>
> sudo apt-get install apache2 php5
>
> Ultimately, I decided to go for a default installation, after having
> taken steps in another direction. I've gone back and edited
>
> /etc/apache2/sites-available/default
>
> to have /var/www/
> (tried /var/www as well)
>
> restarted, yet I can't get output on this simplest of scripts
> $ pwd
> /var/www
> $ ls -l
> total 8
> -rw-r--r-- 1 www-data automation 177 Feb 12 19:08 index.html
> -rw-r--r-- 1 fred automation 20 Feb 18 23:02 test.php
> $ cat test.php
> <?php phpinfo(); ?>
> $
>
> What I get is firefox telling me that it cannot connect to the server at
> localhost.
>
try connecting to 127.0.0.1 instead. If that fails its likely apache
isn't running

Maybe an error in the config. scripts.

try (as root, or using sudo )

/etc/init.d/apache3 restart

and look to see what errors show up.,

also check /var/log/apache2/error.log



> Fishing for tips.


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180473 is a reply to message #180460] Tue, 19 February 2013 13:27 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 2/19/2013 3:56 AM, Cal Dershowitz wrote:
> On 02/12/2013 06:09 AM, Jerry Stuckle wrote:
>
>>
>> I think the easiest way for you to install PHP would be to use the
>> ubuntu package manager. I understand ubuntu isn't much different than
>> debian (which is what I use), and it will preconfigure a working system
>> for you. It's also easy to change the configuration.
>>
>> And no, we aren't flaming. Just having a difference of opinion :).
>>
>
> Jerry, I'm glad you didn't, because I'm not quite there, and it would be
> hard to double back if everyone knew this subthread was engulfed in
> silliness.
>
> It seems people have differing means of accomplishing what I have set
> forth to do here, each catering to their own apache architecture needs.
>
> IMO, the hands-down winner for how to get a LAMP capability on ubuntu
> was supplied most the way with a one-liner by ben:
>
> sudo apt-get install apache2 php5
>
> Ultimately, I decided to go for a default installation, after having
> taken steps in another direction. I've gone back and edited
>
> /etc/apache2/sites-available/default
>
> to have /var/www/
> (tried /var/www as well)
>
> restarted, yet I can't get output on this simplest of scripts
> $ pwd
> /var/www
> $ ls -l
> total 8
> -rw-r--r-- 1 www-data automation 177 Feb 12 19:08 index.html
> -rw-r--r-- 1 fred automation 20 Feb 18 23:02 test.php
> $ cat test.php
> <?php phpinfo(); ?>
> $
>
> What I get is firefox telling me that it cannot connect to the server at
> localhost.
>
> Fishing for tips.

Well, the first thing to check would be to see if Apache is actually
running. If so, then you need to check into your Apache configuration
and/or system configuration (i.e. firewalls, network setup, etc.).

But neither is appropriate for a PHP newsgroup. Maybe one of the Ubuntu
guys can help. If you ask in an appropriate newsgroup, you'll get good
answers. If you ask in the wrong one, you'll usually be chasing your
tail due to incorrect responses.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: getting a php capability on ubuntu was Re: using scripting languages to automate a browser [message #180474 is a reply to message #180473] Wed, 20 February 2013 01:08 Go to previous message
Cal Dershowitz is currently offline  Cal Dershowitz
Messages: 36
Registered: February 2013
Karma: 0
Member
On 02/19/2013 05:27 AM, Jerry Stuckle wrote:

> Well, the first thing to check would be to see if Apache is actually
> running. If so, then you need to check into your Apache configuration
> and/or system configuration (i.e. firewalls, network setup, etc.).
>
> But neither is appropriate for a PHP newsgroup. Maybe one of the Ubuntu
> guys can help. If you ask in an appropriate newsgroup, you'll get good
> answers. If you ask in the wrong one, you'll usually be chasing your
> tail due to incorrect responses.
>

Thx Jerry and everyone who helped me through this. I found invaluable
comment from both fora in getting this squared away.

http://i49.tinypic.com/207m339.png

Super-impressed by the sleekness of this output relative to how big a
command had to create it.

$ sudo service apache2 status
[sudo] password for fred:
Apache2 is NOT running.
$

I had been a little-ambitious for what I was going to do on my first
go-round and tried to create an architecture that is much more than a
literal beginner was going to need, or more importantly, understand.
So, apparently, if you forget to delete the link that ben told me to
delete in /sites-available, then apache2 does not even start with the
default one.

$ pwd
/etc/apache2/sites-enabled
$ ls -l
total 0
lrwxrwxrwx 1 root root 26 Feb 12 19:08 000-default ->
.../sites-available/default
lrwxrwxrwx 1 root root 29 Feb 18 01:39 100-mysite ->
/home/fred/HTTP/mysite.config
$ sudo rm 100-mysite
[sudo] password for fred:
$ ls
000-default
$

Everything looks good.
--
Cal
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: CMS Recommendation
Next Topic: On click button in php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 06:37:39 GMT 2024

Total time taken to generate the page: 0.03047 seconds