php-general Digest 7 Oct 2010 17:24:29 -0000 Issue 6977

Topics (messages 308527 through 308536):

Re: daemon
        308527 by: Nathan Nobbe
        308530 by: Per Jessen
        308532 by: Colin Guthrie
        308533 by: Per Jessen

Re: Vermis - new issue tracker in PHP
        308528 by: Lukasz Cepowski

Re: Continuance of the struggle (trying to understand)
        308529 by: Col Day
        308531 by: a...@ashleysheridan.co.uk
        308534 by: Steve Staples

tedd's Friday Post ($ per line)
        308535 by: tedd
        308536 by: Bastien Koert

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Wed, Oct 6, 2010 at 11:21 PM, Tommy Pham <tommy...@gmail.com> wrote:

> Hi,
>
> Does anyone have a script running as daemon on Linux/Unix (variants) as
> part
> of your PHP application?  If so, what are you using to schedule the script
> to run? cron?
>

cron is one way to do it for scripts you schedule.  for real daemon
processes though ive recently deployed a php script on gentoo by leveraging
the init scripts.  essentially my program runs a while(true) and uses
pcntl_fork() to create worker children.  the parent process listens for
signals which are sent by an init script.  theres also a really nice
start-stop-daemon function in the init script library which backgrounds the
process for me and creates a pid lockfile.  really slick.

now i have an interface to my script like

/etc/init.d/php-service start

etc.  plus it ties right into the runlevel scripts, i just run

rc-update add php-service default

and the script will start when the box hits runlevel 3!

-nathan

--- End Message ---
--- Begin Message ---
Tommy Pham wrote:

> Hi,
> 
> Does anyone have a script running as daemon on Linux/Unix (variants)
> as part of your PHP application?  

Yeah, several. 

> If so, what are you using to schedule the script to run? cron?

sysVinit and startproc



-- 
Per Jessen, Zürich (12.1°C)


--- End Message ---
--- Begin Message ---
'Twas brillig, and Nathan Nobbe at 07/10/10 06:46 did gyre and gimble:
> On Wed, Oct 6, 2010 at 11:21 PM, Tommy Pham <tommy...@gmail.com> wrote:
> 
>> Hi,
>>
>> Does anyone have a script running as daemon on Linux/Unix (variants) as
>> part
>> of your PHP application?  If so, what are you using to schedule the script
>> to run? cron?
>>
> 
> cron is one way to do it for scripts you schedule.  for real daemon
> processes though ive recently deployed a php script on gentoo by leveraging
> the init scripts.  essentially my program runs a while(true) and uses
> pcntl_fork() to create worker children.  the parent process listens for
> signals which are sent by an init script.  theres also a really nice
> start-stop-daemon function in the init script library which backgrounds the
> process for me and creates a pid lockfile.  really slick.
> 
> now i have an interface to my script like
> 
> /etc/init.d/php-service start
> 
> etc.  plus it ties right into the runlevel scripts, i just run
> 
> rc-update add php-service default
> 
> and the script will start when the box hits runlevel 3!

Yeah that's what I do too. Of course systemd will change everything
"initscript" related, but I don't expect it to hit production servers
for a while.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


--- End Message ---
--- Begin Message ---
Colin Guthrie wrote:

> Yeah that's what I do too. Of course systemd will change everything
> "initscript" related, but I don't expect it to hit production servers
> for a while.

Could easily be years - the init-sequence is only interesting at
boot-time, and server runs for years (wel, mine certainly do).


/Per

-- 
Per Jessen, Zürich (12.9°C)


--- End Message ---
--- Begin Message ---
Hello,

Actually I'm planning the 1.0 version of Vermis, if you have any suggestions what should be improved and changed please share.
I'd very appreciate that kind of feedback.
Feel free to download, test and use Vermis.

Thanks,
Lukasz (cepa) Cepowski
DiabloWare :: Software from Hell!
www.diabloware.com | www.cepowski.pl
skype: lukasz.cepowski
cell: +48 502 670 711


--- End Message ---
--- Begin Message ---
Morning all,

Apologies for the delay, I've just become a Dad for the first time so a little distracted!

If I explain exactly what I am trying to do then it may become clear as to where I'm going wrong.

Needless to say, new baby so want to show him off (Callum, 7lb4oz) so decided to buy a webname and pay for hosting, however money is a bit tight, so being adventurous (or stupid, not sure which yet) I set up apache on my laptop and started writing a website in Serif's WebPlus10. However I wanted to have an upload area on the site for friends and family to send their pictures of Callum (and the family and anything else they wanted) so there was a central "store". However I tried to find some html to handle the upload of these files but wasn't able to work it out, google and various other bitsx of research on the net showed that I probably needed to run a script to do this and PHP seemed the simplest, so I downloaded PHP 5.3.3 and installed it.

This is where it started getting tricky as I was using the PHP for dummies book from 2006. I typed that piece of code in (direct from the book) but added it as an html attachment into my site I was building. Uploaded the site to my localhost and had a look. I only got the HTML line from the script. This is where I started contacting you bunch of fine programmers!

I have now learned that if I save the script as a .php file and navigate direct to it on localhost it works fine, but I think what I am trying to do is get it to work in an existing webpage so that I can then get my upload working.

Any help you can offer from explanantions to whole bits of code will be greatly received!

Many thanks!

"Steve Staples" <sstap...@mnsi.net> wrote in message news:1286281586.4703.63.ca...@webdev01...
Col:

If i am reading this correctly, then i think you're looking at this all
wrong.

If you're working within some kind of page, stored outside of the
http://localhost served by apache, like say the .php file is on the
desktop... then yeah, you're not going to get the PHP information
displayed.

(tech people bare with me here...)
PHP pages, are "compiled" when called... so you need apache to call php
and translate the PHP code so that if there is any output, it will
display that output.

If you're trying to show a .php file from teh desktop, then apache isn't
handeling this request, and therefor has no idea that there is php code
that has to be compiled, and therefore it will just ignore it.

I am sure that I am goign to get flamed for that, but i think that it
kinda simplifies what apache does for php.

NOW... you can run a php file from the command line, but you're not
going to get the HTML results as you would had you ran if from the
localhost where apache knows what to do with a .php file.

So... long story short, if you want PHP to display the PHP stuff, then
you will need to have it interpreted by apache (or IIS, or whatever your
web server software is) to have it spit back to a web browser client.

Hopefully this makes sense, it is early here, i am just getting into
work :(, and it made sense while i was typing it... but my coffee intake
has not had time to work it's wonderful magic with me yet, so my
thoughts may be scattered.

Steve



On Tue, 2010-10-05 at 12:57 +0100, Col Day wrote:
LOL!

This is WITH xammp!!



"Gary" <php-gene...@garydjones.name> wrote in message
news:i8f26m$j4...@dough.gmane.org...
> Col Day wrote:
>> ""Col Day"" <colind...@aol.com> wrote in message
>> news:23.81.45586.2820b...@pb1.pair.com...
>>>    <html>
>>>    <head>
>>>    <title>PHP Test</title>
>>>    </head>
>>>    <body>
>>>    <p>This is an HTML line
>      </p> <!-- close your tag, you evil man! :-) -->
>>>    <?php
>>>       echo "<p>This is a PHP line</p>";
>>>       phpinfo();
>>>    ?>
>>>    </body>
>>>    </html>
>
>> If I paste this into a webpage I only get the "HTML" line as before.
>
> What do you mean, "webpage"? foo.php, for example, or foo.html? If the
> latter then I am guessing your Apache will serve the page purely as
> html, and it will never be processed by php. If the former then check
> that Apache is configured to run php files through php before serving
> them (must admit, I'm not sure how to do that, it depends on your > Apache
> and PHP). Or, really, just install xampp, it's by far the easiest way
> and will avoid all the problems associated with configuring two rather
> complex pieces of software.
>






--- End Message ---
--- Begin Message ---
It will only work if your listing supports php, but you should just be able to 
put the whole sure up on your hosting, give the upload directory the correct 
permissions ( its most likely a more secure Linux hosting than insecure windows 
hosting) 

Thanks,
Ash
http://www.ashleysheridan.co.uk

----- Reply message -----
From: "Col Day" <colind...@aol.com>
Date: Thu, Oct 7, 2010 08:33
Subject: [PHP] Re: Continuance of the struggle (trying to understand)
To: <php-gene...@lists.php.net>

Morning all,

Apologies for the delay, I've just become a Dad for the first time so a 
little distracted!

If I explain exactly what I am trying to do then it may become clear as to 
where I'm going wrong.

Needless to say, new baby so want to show him off (Callum, 7lb4oz) so 
decided to buy a webname and pay for hosting, however money is a bit tight, 
so being adventurous (or stupid, not sure which yet) I set up apache on my 
laptop and started writing a website in Serif's WebPlus10. However I wanted 
to have an upload area on the site for friends and family to send their 
pictures of Callum (and the family and anything else they wanted) so there 
was a central "store". However I tried to find some html to handle the 
upload of these files but wasn't able to work it out, google and various 
other bitsx of research on the net showed that I probably needed to run a 
script to do this and PHP seemed the simplest, so I downloaded PHP 5.3.3 and 
installed it.

This is where it started getting tricky as I was using the PHP for dummies 
book from 2006. I typed that piece of code in (direct from the book) but 
added it as an html attachment into my site I was building. Uploaded the 
site to my localhost and had a look. I only got the HTML line from the 
script. This is where I started contacting you bunch of fine programmers!

I have now learned that if I save the script as a .php file and navigate 
direct to it on localhost it works fine, but I think what I am trying to do 
is get it to work in an existing webpage so that I can then get my upload 
working.

Any help you can offer from explanantions to whole bits of code will be 
greatly received!

Many thanks!

"Steve Staples" <sstap...@mnsi.net> wrote in message 
news:1286281586.4703.63.ca...@webdev01...
> Col:
>
> If i am reading this correctly, then i think you're looking at this all
> wrong.
>
> If you're working within some kind of page, stored outside of the
> http://localhost served by apache, like say the .php file is on the
> desktop... then yeah, you're not going to get the PHP information
> displayed.
>
> (tech people bare with me here...)
> PHP pages, are "compiled" when called... so you need apache to call php
> and translate the PHP code so that if there is any output, it will
> display that output.
>
> If you're trying to show a .php file from teh desktop, then apache isn't
> handeling this request, and therefor has no idea that there is php code
> that has to be compiled, and therefore it will just ignore it.
>
> I am sure that I am goign to get flamed for that, but i think that it
> kinda simplifies what apache does for php.
>
> NOW... you can run a php file from the command line, but you're not
> going to get the HTML results as you would had you ran if from the
> localhost where apache knows what to do with a .php file.
>
> So... long story short, if you want PHP to display the PHP stuff, then
> you will need to have it interpreted by apache (or IIS, or whatever your
> web server software is) to have it spit back to a web browser client.
>
> Hopefully this makes sense, it is early here, i am just getting into
> work :(, and it made sense while i was typing it... but my coffee intake
> has not had time to work it's wonderful magic with me yet, so my
> thoughts may be scattered.
>
> Steve
>
>
>
> On Tue, 2010-10-05 at 12:57 +0100, Col Day wrote:
>> LOL!
>>
>> This is WITH xammp!!
>>
>>
>>
>> "Gary" <php-gene...@garydjones.name> wrote in message
>> news:i8f26m$j4...@dough.gmane.org...
>> > Col Day wrote:
>> >> ""Col Day"" <colind...@aol.com> wrote in message
>> >> news:23.81.45586.2820b...@pb1.pair.com...
>> >>>    <html>
>> >>>    <head>
>> >>>    <title>PHP Test</title>
>> >>>    </head>
>> >>>    <body>
>> >>>    <p>This is an HTML line
>> >      </p> <!-- close your tag, you evil man! :-) -->
>> >>>    <?php
>> >>>       echo "<p>This is a PHP line</p>";
>> >>>       phpinfo();
>> >>>    ?>
>> >>>    </body>
>> >>>    </html>
>> >
>> >> If I paste this into a webpage I only get the "HTML" line as before.
>> >
>> > What do you mean, "webpage"? foo.php, for example, or foo.html? If the
>> > latter then I am guessing your Apache will serve the page purely as
>> > html, and it will never be processed by php. If the former then check
>> > that Apache is configured to run php files through php before serving
>> > them (must admit, I'm not sure how to do that, it depends on your 
>> > Apache
>> > and PHP). Or, really, just install xampp, it's by far the easiest way
>> > and will avoid all the problems associated with configuring two rather
>> > complex pieces of software.
>> >
>>
>>
>
> 


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


--- End Message ---
--- Begin Message ---
Col:

Congratulations on becoming a father!!   As a father of 3 myself, I know
the joys that infants bring :)

As for your scripting issues, I would suggest that you save your files
with the .php extension, and not the .html.   The .php extension will
tell the php compliler/parser/whatever and spit back the "compiled" php
script.

If you're looking to just have a "photo gallery", there are many
free/opensource gallery scripts out there that you can use.  Mind you,
there is no "sense of accomplishment" when you do it this way, but if
you're unsure about security, and file injection/sql injection, then you
may be better off using one of those, until you're further along in your
book :)

http://www.google.ca/#sclient=psy&hl=en&q=opesource+php
+gallery&aq=f&aqi=g-sx1g-o1&aql=&oq=&gs_rfai=&pbx=1&fp=f85a0cf66583c3ac

in the past, I set up coppermine for a friend of mine, and he said it
works ok... but like I said, there are lots out there, and maybe
consider using one of them for now, so you can spend more time with your
new baby :)

Steve.



On Thu, 2010-10-07 at 09:00 +0100, a...@ashleysheridan.co.uk wrote:
> It will only work if your listing supports php, but you should just be able 
> to put the whole sure up on your hosting, give the upload directory the 
> correct permissions ( its most likely a more secure Linux hosting than 
> insecure windows hosting) 
> 
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 
> ----- Reply message -----
> From: "Col Day" <colind...@aol.com>
> Date: Thu, Oct 7, 2010 08:33
> Subject: [PHP] Re: Continuance of the struggle (trying to understand)
> To: <php-gene...@lists.php.net>
> 
> Morning all,
> 
> Apologies for the delay, I've just become a Dad for the first time so a 
> little distracted!
> 
> If I explain exactly what I am trying to do then it may become clear as to 
> where I'm going wrong.
> 
> Needless to say, new baby so want to show him off (Callum, 7lb4oz) so 
> decided to buy a webname and pay for hosting, however money is a bit tight, 
> so being adventurous (or stupid, not sure which yet) I set up apache on my 
> laptop and started writing a website in Serif's WebPlus10. However I wanted 
> to have an upload area on the site for friends and family to send their 
> pictures of Callum (and the family and anything else they wanted) so there 
> was a central "store". However I tried to find some html to handle the 
> upload of these files but wasn't able to work it out, google and various 
> other bitsx of research on the net showed that I probably needed to run a 
> script to do this and PHP seemed the simplest, so I downloaded PHP 5.3.3 and 
> installed it.
> 
> This is where it started getting tricky as I was using the PHP for dummies 
> book from 2006. I typed that piece of code in (direct from the book) but 
> added it as an html attachment into my site I was building. Uploaded the 
> site to my localhost and had a look. I only got the HTML line from the 
> script. This is where I started contacting you bunch of fine programmers!
> 
> I have now learned that if I save the script as a .php file and navigate 
> direct to it on localhost it works fine, but I think what I am trying to do 
> is get it to work in an existing webpage so that I can then get my upload 
> working.
> 
> Any help you can offer from explanantions to whole bits of code will be 
> greatly received!
> 
> Many thanks!
> 
> "Steve Staples" <sstap...@mnsi.net> wrote in message 
> news:1286281586.4703.63.ca...@webdev01...
> > Col:
> >
> > If i am reading this correctly, then i think you're looking at this all
> > wrong.
> >
> > If you're working within some kind of page, stored outside of the
> > http://localhost served by apache, like say the .php file is on the
> > desktop... then yeah, you're not going to get the PHP information
> > displayed.
> >
> > (tech people bare with me here...)
> > PHP pages, are "compiled" when called... so you need apache to call php
> > and translate the PHP code so that if there is any output, it will
> > display that output.
> >
> > If you're trying to show a .php file from teh desktop, then apache isn't
> > handeling this request, and therefor has no idea that there is php code
> > that has to be compiled, and therefore it will just ignore it.
> >
> > I am sure that I am goign to get flamed for that, but i think that it
> > kinda simplifies what apache does for php.
> >
> > NOW... you can run a php file from the command line, but you're not
> > going to get the HTML results as you would had you ran if from the
> > localhost where apache knows what to do with a .php file.
> >
> > So... long story short, if you want PHP to display the PHP stuff, then
> > you will need to have it interpreted by apache (or IIS, or whatever your
> > web server software is) to have it spit back to a web browser client.
> >
> > Hopefully this makes sense, it is early here, i am just getting into
> > work :(, and it made sense while i was typing it... but my coffee intake
> > has not had time to work it's wonderful magic with me yet, so my
> > thoughts may be scattered.
> >
> > Steve
> >
> >
> >
> > On Tue, 2010-10-05 at 12:57 +0100, Col Day wrote:
> >> LOL!
> >>
> >> This is WITH xammp!!
> >>
> >>
> >>
> >> "Gary" <php-gene...@garydjones.name> wrote in message
> >> news:i8f26m$j4...@dough.gmane.org...
> >> > Col Day wrote:
> >> >> ""Col Day"" <colind...@aol.com> wrote in message
> >> >> news:23.81.45586.2820b...@pb1.pair.com...
> >> >>>    <html>
> >> >>>    <head>
> >> >>>    <title>PHP Test</title>
> >> >>>    </head>
> >> >>>    <body>
> >> >>>    <p>This is an HTML line
> >> >      </p> <!-- close your tag, you evil man! :-) -->
> >> >>>    <?php
> >> >>>       echo "<p>This is a PHP line</p>";
> >> >>>       phpinfo();
> >> >>>    ?>
> >> >>>    </body>
> >> >>>    </html>
> >> >
> >> >> If I paste this into a webpage I only get the "HTML" line as before.
> >> >
> >> > What do you mean, "webpage"? foo.php, for example, or foo.html? If the
> >> > latter then I am guessing your Apache will serve the page purely as
> >> > html, and it will never be processed by php. If the former then check
> >> > that Apache is configured to run php files through php before serving
> >> > them (must admit, I'm not sure how to do that, it depends on your 
> >> > Apache
> >> > and PHP). Or, really, just install xampp, it's by far the easiest way
> >> > and will avoid all the problems associated with configuring two rather
> >> > complex pieces of software.
> >> >
> >>
> >>
> >
> > 
> 
> 


-- 

Steve Staples
Web Application Developer
519.258.2333 x8414


--- End Message ---
--- Begin Message ---
Hi gang:

Several years ago I was involved in a court case where a programmers work was being evaluated to establish a dollar amount for the work done.

The case was a dispute where the client wanted money back from a programmer for a discontinued project. The programmer simply wanted to be paid for the work he had done. This wasn't a case where anyone had done anything wrong, but rather a circumstance where two parties were trying to figure out who was due what.

You see, the original client had been taken over by another company who put a halt to the project the programmer was working on. The new company claimed that because the project wasn't finished, then the programmer should pay back all the money he was paid up-front to start the project. However, while the project had not been finished, the programmer had indeed worked on the project for several months.

The programmer stated he wanted to paid his hourly rate. But the new client stated that the up-front money paid had been based upon a bid and not an hourly rate. So, they were at odds as to what to do.

The solution in this case was to place a dollar amount on the actual "lines of code" the programmer wrote. In other words, they took all of programmers code and actually counted the lines of code he wrote and then agreed to a specific dollar amount to each line. In this case, the programmer had written over 25,000 lines of code. What do you think he was paid?

And with all of that said, what dollar amount would you place on your "line of code"?

Cheers,

tedd

--
-------
http://sperling.com/

--- End Message ---
--- Begin Message ---
On Thu, Oct 7, 2010 at 1:20 PM, tedd <tedd.sperl...@gmail.com> wrote:
> Hi gang:
>
> Several years ago I was involved in a court case where a programmers work
> was being evaluated to establish a dollar amount for the work done.
>
> The case was a dispute where the client wanted money back from a programmer
> for a discontinued project. The programmer simply wanted to be paid for the
> work he had done. This wasn't a case where anyone had done anything wrong,
> but rather a circumstance where two parties were trying to figure out who
> was due what.
>
> You see, the original client had been taken over by another company who put
> a halt to the project the programmer was working on. The new company claimed
> that because the project wasn't finished, then the programmer should pay
> back all the money he was paid up-front to start the project. However, while
> the project had not been finished, the programmer had indeed worked on the
> project for several months.
>
> The programmer stated he wanted to paid his hourly rate. But the new client
> stated that the up-front money paid had been based upon a bid and not an
> hourly rate. So, they were at odds as to what to do.
>
> The solution in this case was to place a dollar amount on the actual "lines
> of code" the programmer wrote. In other words, they took all of programmers
> code and actually counted the lines of code he wrote and then agreed to a
> specific dollar amount to each line. In this case, the programmer had
> written over 25,000 lines of code. What do you think he was paid?
>
> And with all of that said, what dollar amount would you place on your "line
> of code"?
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I bet it wasn't much., $.10 (ten cents) per line?



-- 

Bastien

Cat, the other other white meat

--- End Message ---

Reply via email to