php-general Digest 31 Jan 2013 19:21:44 -0000 Issue 8107

Topics (messages 320128 through 320132):

[SOLVED] Re: [PHP] php5.3 exec() : output truncate
        320128 by: patrick ficheux

Re: Web User Management
        320129 by: Alex Pojarsky
        320130 by: marco.behnke.biz

[PHP-DEV] PHP 5.3.22RC1 and 5.4.12RC1 Released for Testing!
        320131 by: Johannes Schlüter

Complex MySQL query for lowest price
        320132 by: Angela Barone

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 ---
I found the reason of this issue : SELinux

by defaut, SELinux is enabled on CentOS5.5 => httpd runs with "restricted rights"

If I temporary disabled SELinux + restart httpd => "ps -A" from my script runs as expected
    $ setenforce 0
    $ /etc/init.d/httpd restart



Le 30/01/2013 19:14, patrick ficheux a écrit :
Hi,

I want to get the list of running processes. also, I call exec() with "ps -A"
(ps -A displays almost all processes of all users)
Unfortunatly, the output of "ps -A" seems incomplete

the test file test.php:
<?php
unset($buf);
unset($res);
exec("ps -A", $buf, $res);
for($i=0; $i < count($buf); $i++)
{
    echo($buf[$i]."<br>");
}
?>

If I run the test.php under the context of httpd (from http://<server>/test.php), I can see only a subset of running processes (some processes of user "apache")

PID TTY TIME CMD
3207 ? 00:00:00 httpd
3359 ? 00:00:00 httpd
3360 ? 00:00:00 httpd
3361 ? 00:00:00 httpd
3362 ? 00:00:00 httpd
3363 ? 00:00:00 httpd
3364 ? 00:00:00 httpd
3365 ? 00:00:00 httpd
3366 ? 00:00:00 httpd
3569 ? 00:00:00 ps

If I run the same script directly from php (from user apache) , I can see *all* processes as expected

# sudo -u apache php -f test.php
  PID TTY          TIME CMD<br>
    1 ?        00:00:01 init<br>
    2 ?        00:00:00 migration/0<br>
    3 ?        00:00:00 ksoftirqd/0<br>
    4 ?        00:00:00 watchdog/0<br>
    5 ?        00:00:00 events/0<br>
    6 ?        00:00:00 khelper<br>
[...]

Is it a problem with exec() or with "ps -A" or with .... ?

any ideas ?


more information :
OS = centos 5.5
# httpd -v
Server version: Apache/2.2.3
Server built:   Jan 10 2013 08:22:14
# php -v
PHP 5.3.3 (cli) (built: Jun 27 2012 12:25:37)




--- End Message ---
--- Begin Message ---
Hey.

Depends on your customisation needs. If you need something robust and don't
need anything very specific - you should be ok with Drupal, Joomla or
something similar. If you are going to need a lot of complex internals that
are not in these engines - you may want to try some lightweight flexible
framework like CodeIgniter or Kohana.
On Jan 30, 2013 4:19 PM, "Adolfo Olivera" <olivera.ado...@gmail.com> wrote:

> Hi,
>
>    I'm about to start a little project using PHP and MySQL. It involves
> some basic user management. Like most web systems. Users would need to be
> able to:
>
>
>
> 1 Create Accounts.
>
> 2 Update and recover passwords.
>
> 3 Maintain a session to operate.
> 4 Something else I might be forgetting.
>
>
>
> My questions are
>
> 1 Is there some kind of library, framework I could utilize to save me some
> work?
>
> 2 Any thoughts, lessons learned from more senior programmers, I'm fairly
> new with PHP.
>

--- End Message ---
--- Begin Message ---

Adolfo Olivera <olivera.ado...@gmail.com> hat am 30. Januar 2013 um 17:19
geschrieben:
> >You can take a look at the classes from the Zend Framework (they can be
> used
> >stand alone as well)
>
> Thanks Marco, which classes specifically are you talking about. Where can I
> download them from and get documentation on them? I looked into zend's web
> site and it is a bit overwhelming, so may be you can point me in the right
> direction.

http://framework.zend.com/manual/1.12/de/zend.acl.html


>
> On Wed, Jan 30, 2013 at 11:53 AM, ma...@behnke.biz <ma...@behnke.biz> wrote:
>
> > Adolfo Olivera <olivera.ado...@gmail.com> hat am 30. Januar 2013 um 15:18
> > geschrieben:
> > > My questions are
> > >
> > > 1 Is there some kind of library, framework I could utilize to save me
> > some
> > > work?
> >
> > You can take a look at the classes from the Zend Framework (they can be
> > used
> > stand alone as well)
> >
> > > 2 Any thoughts, lessons learned from more senior programmers, I'm fairly
> > > new with PHP.
> >
> > Think about security issues like encrypted transfer of passwords, sessions
> > hijacking, sql injection, sessions without cookies and stuff like that.
> >
> > --
> > Marco Behnke
> > Dipl. Informatiker (FH), SAE Audio Engineer Diploma
> > Zend Certified Engineer PHP 5.3
> >
> > Tel.: 0174 / 9722336
> > e-Mail: ma...@behnke.biz
> >
> > Softwaretechnik Behnke
> > Heinrich-Heine-Str. 7D
> > 21218 Seevetal
> >
> > http://www.behnke.biz
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> Adolfo Olivera
> 15-3429-9743

--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

--- End Message ---
--- Begin Message ---
Hi!

We've released PHP 5.3.22RC1 and 5.4.12RC1 which can be found here:

   5.3.20RC1:
   http://downloads.php.net/johannes/php-5.3.22RC1.tar.bz2
   http://downloads.php.net/johannes/php-5.3.22RC1.tar.gz

   5.4.10RC1:
   http://downloads.php.net/stas/php-5.4.12RC1.tar.bz2
   http://downloads.php.net/stas/php-5.4.12RC1.tar.gz

Windows binaries for both, as always, are at:
    http://windows.php.net/qa/

These are regular bugfix releases, the full list of issues fixed can be
found in the NEWS files. Please test and report if anything is broken.

If no critical issues is found in this RC, the final version will be
released in two weeks.

Regards,
    Stas Malyshev, Johannes Schlüter




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

        I have a formula that says, if 'specialprice' is not empty and it is 
lower than 'unitprice', use 'specialprice', otherwise use 'unitprice':

<?php $result = mysql_query("SELECT 
LEAST(unitprice,ifnull(specialprice,'9999')) AS used_price FROM catalog WHERE 
itemid='WB1836C'",$db);
printf('<b><font color="#555555">Your Price:</font> $%s</b><br />', 
number_format(mysql_result($result,0,"used_price"),2)); ?>

        What I'd like is to add a starting and ending date and if today's date 
is between those dates, then do the above formula, otherwise if today's date is 
not between those dates, then just use 'unitprice'.

        This is starting to get too complex for me, so I need some help. ;)  
Hopefully this makes sense.  If I need to be clearer, please let me know.

Thanks!
Angela

--- End Message ---

Reply via email to