On 8/25/12 6:11 AM, Matijn Woudt wrote:
Hi Dante,
Wouldn't it be much easier to use reseller packages like DirectAdmin
or cPanel? AFAIK it should be pretty easy to do the things above.
I'm considering that as well. In the end, I really only want 3
features, however:
- ftp access to files
that has replaced it since then.
-- Dante
On Wed, Aug 22, 2012 at 6:26 AM, D. Dante Lorenso da...@lorenso.com
mailto:da...@lorenso.com wrote:
All,
I need to set up a server to enable 5,000 students to have web
hosting provided by the school with PHP and MySQL support. I'm
All,
I need to set up a server to enable 5,000 students to have web hosting
provided by the school with PHP and MySQL support. I'm trying to figure
out what is the best way to do this.
We have Active Directory and are using Centrify to authenticate
usernames and passwords on our Linux
The school I work with wants to set up PHP and MySQL hosting for about
10,000 students.
I see that in 5.4, PHP safe-mode is being removed. How is it supposed
to be done if not safe-mode?
Are all the hosting providers using suExec and running PHP as CGI or
FastCGI? If I'm trying to do this
bytes in your file as you shuttle chunks to the client instead of
slooping it all into memory in one hunk.
-- Dante
D. Dante Lorenso
da...@lorenso.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
All,
I want to build a config file class that gets called statically. Is
there such a thing as a static constructor? Example:
class Daz_Config {
public static function load() {
...
}
public static function get($key) {
self :: load();
...
}
}
Daz_Config ::
On 3/28/11 8:18 PM, Jack wrote:
Hello All,
Is there a smarter way to do includes by setting up a path or something
where I don't have to include /home/domain.com/includes/include_file.php
Apparently my path is as shown above, but I would prefer to just put in
/includes/include_file.php
I
On 2/18/11 8:39 AM, Kirk Bailey wrote:
Oh hey, that's a good point. All the stuff i saw so far indented 2
spaces. WHY?
Can I just indent a TAB if my editor permits this? indenting 4 spaces (2
nests) is easy, but suppose I hit one extra space- not enough difference
to be really noticeable. Let's
character position in the string. Ron
... but you sound like you are looking for the 'wordwrap' function.
-- Dante
--
D. Dante Lorenso
da...@lorenso.com
972-333-4139
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 11/11/10 12:04 PM, Michael Shadle wrote:
Not to discredit this long post but the media here is now calling
kids who text often hypertexting teens which really irked me
even more...I bet some non-technical news guy thinks he is
awesome for coming up with that one.
LOL! I too thought those
.
-- Dante
--
D. Dante Lorenso
da...@lorenso.com
972-333-4139
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
All,
I want to start using PHP namespaces for my projects. Currently, I name
my classes similar to how Zend Framework names theirs and I end up with
classes like:
LS_Util_String
I'm thinking that if I converted this to namespaces, the classes would
be named like:
LS\Util\String
I'd
a server shutdown (don't need to be written to disk), but I can
not afford for the server to throw away values that don't fit into
memory. If there is a way to configure memcached guarantee storage,
that might work.
-- Dante
On Sun, Jan 24, 2010 at 9:39 AM, D. Dante Lorenso da...@lorenso.com
shiplu wrote:
On Sun, Jan 24, 2010 at 3:11 AM, D. Dante Lorenso da...@lorenso.com wrote:
All,
I'm loading millions of records into a backend PHP cli script that I
need to build a hash index from to optimize key lookups for data that
I'm importing into a MySQL database. The problem
All,
I'm loading millions of records into a backend PHP cli script that I
need to build a hash index from to optimize key lookups for data that
I'm importing into a MySQL database. The problem is that storing this
data in a PHP array is not very memory efficient and my millions of
records are
If you are using PostgreSQL, there is a 'connectby' function (part of
contrib) which will recursively join hierarchical data where you have
PID -- ID recursive joins. Oracle also has CONNECT BY built into the
SQL language. I do not know if MySQL natively supports anything similar
but maybe
Albert Padley wrote:
Thanks everyone. Always nice to know there is more than one direction
to go in.
A alternative to variable variables might use these:
http://us3.php.net/manual/en/function.compact.php
http://us3.php.net/manual/en/function.extract.php
'extract' looks like it might be
Dave Goodchild wrote:
if $_REQUEST['page'] is not set, why not do this:
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
(ternary operator)
// test, numeric read, with default and bounds checking
$page = empty($_REQUEST['page']) ? 1 : intval($_REQUEST['page']);
$page = min(max($page,
All,
I just discovered this neat little gem in MySQL which makes it easy to
page large result sets:
* SELECT SQL_CALC_FOUND_ROWS *
FROM table
LIMIT 10, 10
* SELECT FOUND_ROWS()
The neat thing is that SQL_CALC_FOUND_ROWS will cause MySQL to tally up
all the rows that WOULD
Richard Lynch wrote:
3. use the built-in cursor of PostgreSQL which pre-dates MySQL
LIMIT and OFFSET clauses, which are non-standard hacks Rasmus
introduced back in the day.
Care to elaborate? Cast into context of PDO if you can...?
Dante
--
PHP General Mailing List (http://www.php.net/)
To
[EMAIL PROTECTED] wrote:
I need to calculate no. of days between two dates, actually between date
stored in DB and today's date.
Does anybody has an example I can use?
Your database will have this function. In PostgreSQL:
SELECT data_column - NOW() AS date_diff;
There are similar
Ashley M. Kirchner wrote:
I have a form with various fields on it that I want to make sure
aren't empty or the user didn't just hit the space bar or return (in a
text field). What's the best way to do this? Seems empty() will fail
on a textarea if the user simply hits a space or return and
Mariano Guadagnini wrote:
Hi list,
I hace an existencial doubt: i've seem many scripts declaring classes
as stdClass. In the documentation (for PHP5 and also for 4), it says
that this class is internal of php, and should't be used. By the
manner I saw it's being used, i guess that it can be
Jon wrote:
Seriously guys... am I completely missing something important here?
An empty array evaluates as false. The null character evaluates as
false. The STRING 0 even evaluates as false yet a binary zero does
not?
Even better yet bindec() doesn't appear to be binary safe so it will
weetat wrote:
Hi all,
I am using php 4.3.2 and mysql , linux.
I have a sql statement below :
UPDATE tbl_chassis_temp SET country = 'Singapore', city
'SINGAPORE', building = 'Tampines Central 6', other = 'Level 03-40',
I need to remove the last comma from sql text above.
I have
Jon wrote:
The second thing that needs to be said here is simply a re-statement
of the original, this time more verbosely. The list of things in php
that evaluate as false is as follows:
* the boolean FALSE itself
* the integer 0 (zero)
* the float 0.0 (zero)
* the empty string, and the
[EMAIL PROTECTED] wrote:
What are some of the other killer features of PHP5 that I may be sleeping on
here.
You have got to get your hands on XMLWriter. I don't write any XHTML
inside php any more. I've wrapped the XMLWriter object inside my own
object and now I can create 100%
I was about to write code to recursively list the contents of a
directory when I remembered seeing an object in SPL that would do it for me:
http://us3.php.net/manual/en/function.recursivedirectoryiterator-next.php
But there is no documentation on this object, and although I have it in
Jochem Maas wrote:
also take a look here:
http://www.wiki.cc/php/RecursiveDirectoryIterator
yes it's meant to be used, yes you can use it in production BUT your
a little on the bleeding edge (not very many people using it full on) AND
the whole of SPL is still a little in flex (as is php5-php6
Paul Goepfert wrote:
... What this script does is selects tomorrows date...
Here is a one-line way to find the month and day of tomorrow:
?php
list($tomorrow_month, $tomorrow_day) = split(':', date('m:d',
time()+86400));
?
Test that ... I just wrote it off the top of my head. Maybe that
All,
I want to clean up my PHP.ini file on production to be as streamlined as
possible so that it's easier to work with and maintain. It is easier to
do a diff of my INI and the recommended INI if both files are very
similar with whitespace removed, comments cleaned out, and keys sorted,
All,
Can anybody give me a pointer on where I might start to learn how to
embed Zend2/PHP 5 inside a stand-alone C application?
I realize that by asking a question like this it might imply I am not
prepared enough to do handle the answer, but ignoring that, is there a
document out there?
Dallas Cahker wrote:
how do I get the subdirectory that a page is being pulled from.
say I have three sites running the same script and I need to determine
which
site is which.
http://www.domain.com/subdir1
http://www.domain.com/subdir2
http://www.domain.com/subdir3
and subdir1, subdir2 and
Robert Samuel White wrote:
When I ran the command:
pecl install zip-1.3.1
It intalled the zip.so file to:
/usr/local/lib/php/extensions/no-debug-non-zts-20050922/zip.so
Extensions are compiled with a given Zend/PHP API. The zip extension
you installed was compiled against the API dated
I am using XMLWriter with PHP 5.1.4 and find that it doesn't behave as I
expect. I am under the impressing that until I call 'endElement', I
should be free to continue adding attributes to an opened element
regardless of whether I have already added elements or text below it.
Look at this
Rob Richards wrote:
Expected behavior. See comments within code snippet.
D. Dante Lorenso wrote:
I am using XMLWriter with PHP 5.1.4 and find that it doesn't behave
as I expect. I am under the impressing that until I call
'endElement', I should be free to continue adding attributes
Richard Lynch wrote:
On Thu, May 11, 2006 6:02 pm, D. Dante Lorenso wrote:
pecl install memcache
Is it possible that pecl has an --extension-dir flag to tell it WHERE
to install stuff, or perhaps an optional command line arg or ...
Cuz, really, the odds on it being where you want
Richard Lynch wrote:
On Tue, May 16, 2006 10:34 am, D. Dante Lorenso wrote:
Richard Lynch wrote:
On Thu, May 11, 2006 6:02 pm, D. Dante Lorenso wrote:
pecl install memcache
s it possible that pecl has an --extension-dir flag to tell it
WHERE
to install stuff, or perhaps
I'm on the latest and greatest PHP 5.1.4. I can see the function I
think I want in the manual:
http://us3.php.net/manual/en/function.xmlwriter-write-raw.php
But the manual says it's only in CVS. I confirmed that I don't have it:
*Fatal error*: Call to undefined function
Marcus Boerger wrote:
I think that's a bug and not a feature. Why was this changed?
It is called write support. I think we are going to add a flag
so that one can specify whether write support is enabled or not.
Creating data without using '=' assignment or calling a function is
All,
I'm interested in a PHP application server that is non-webserver based
which I can run on Linux. I was hoping for something like:
* http://www.vl-srm.net/index.php
Does anyone know about this project? It appears to be dead. Hasn't
been updated in a couple years. Is there a
All,
I'm really having a hard time making sense of PECL and PEAR. My
understanding is that PECL is for PHP extensions (written in C using the
extension API) and that PEAR is a repository of PHP modules (classes
written in PHP using the PEAR-approved framework).
PEAR VS PECL COMMANDS
On my
Steven Stromer wrote:
For years I was lulled into thinking I understood php include
functions...
I have always used relative paths in my include and related functions,
for instance:
include_once (lib/included.php);
However, I am now needing to switch to absolute paths:
include_once
All,
I installed an extension via PECL and it seems to have plopped the
extension into it's own extension directory instead of the one in my
PHP.ini file.
pecl install memcache
/usr/lib/php/extensions/no-debug-non-zts-20050922/memcache.so
But my PHP.ini file says to use:
grep
If you are using PHP 5, you might have some fun with the __autoload()
function. I use something like this in production:
//--
function __autoload($class_name) {
require_once ($class_name..php);
}
function push_libs() {
I've recently upgraded to PHP 5.1.4 from 5.1.2 and noticed that in 5.1.3
there were changes made to SimpleXML. Now, when I touch an element
which didn't used to exist, instead of acting like it didn't exist, it
creates it! That's horrible!
Well, this used to work:
?php
$xmlstr =
Does anyone know if it's possible to reference class constants or static
variables without having to use 'self::' all the time?
class A {
const MY_CONSTANT = true;
public function test() {
echo self :: MY_CONSTANT; // works
echo MY_CONSTANT; // doesn't work
}
}
I don't
John Wells wrote:
On 5/9/06, D. Dante Lorenso [EMAIL PROTECTED] wrote:
Does anyone know if it's possible to reference class constants or static
variables without having to use 'self::' all the time?
No, ... Why? The reason is SCOPE.
As wonderful as PHP is, it can't read your mind. So
D. Dante Lorenso wrote:
As an OOP programmer, I would expect the scope search to be as follows:
1. LOCAL: current method
2. THIS: current instance ($this)
3. SELF: current class parent classes, in order of inheritance
4. GLOBAL: globals
Actually, 2 and 3 are really the same but only
All,
I have a file which I want to stream from PHP:
readfile($file_name);
However, this function has the problem that it reads the whole file into
memory and then tries to write it to output. Sometimes, you can hit the
memory limit in PHP before the file contents are completely output
Jochem Maas wrote:
D. Dante Lorenso wrote:
All,
I have a file which I want to stream from PHP:
it's not that relevant, but, I don't thinking streaming is the correct
term.
your merely dumping a files' content to std output.
readfile($file_name);
the trick you need to employ
Eric Butera wrote:
On 5/9/06, D. Dante Lorenso [EMAIL PROTECTED] wrote:
To do this, I would think I need a function in PHP which will output a
buffered stream with blocking enabled. Can anybody point me in the
right direction?
I'm probably way off base on what you're trying to do, but maybe
Chris wrote:
readfile works by reading in the whole file at once - if you don't
want it to do that, you can't use readfile.
You don't need anything complicated, or am I misunderstanding the
question which is more likely..
$size = 1048576; // 1Meg.
$fp = fopen($big_file1, 'rb');
Jochem Maas wrote:
D. Dante Lorenso wrote:
$x = ($y == self :: MY_CONSTANT || $y == self :: MY_CONSTANT2);
I hate the spaces around the '::' whynot self::MY_CONSTANT?
Stupid PHP Eclipse code beautifier ;-) It's what I use to beautify and
since it always does that, I've been forced
Richard Lynch wrote:
On Tue, May 9, 2006 11:11 pm, D. Dante Lorenso wrote:
will 'echo' block until the client has consumed the whole $size amount
of data? If not, how fast will your while loop execute? If
file_size($big_file1) exceeds 1 TB, does your server end up sucking up
all available
Richard Lynch wrote:
On Tue, May 9, 2006 4:48 pm, D. Dante Lorenso wrote:
If
the search for my constant follows the search I've listed above, self
would never be necessary unless you wanted to pinpoint 3 directly.
Under this same line of thinking, though, '$this-' really shouldn't
Richard Lynch wrote:
On Tue, May 9, 2006 12:42 pm, D. Dante Lorenso wrote:#1.
You might do:
define('MY_CONSTANT', true);
class A {
const MY_CONSTANT = MY_CONSTANT;
}
Then you can sort of have the best of both worlds...
Though in a hack sort of way. :-^
Hehe, nice. No thanks ;-) Keep yer
XML-RPC gurus,
Does anyhow know how to set the character encoding for XML-RPC?
I am using the PHP built-in XML-RPC server to handle XML-RPC calls.
?php
...
// create the XML-RPC server
$this-SERVER = xmlrpc_server_create();
...
// fetch the raw input stream which contains our XML data
Jochem Maas wrote:
php will not have late (runtime) static binding until at least version 6.
this sucks, it has sucked since 2003, welcome to the club of people
who think
it sucks :-)
Oh cool there's a club, lol!? Why, thanks for having me! I'm a
card-carrying member. Let me just add
D. Dante Lorenso wrote:
Does anyhow know how to set the character encoding for XML-RPC?
Ok, after digging through the sources, I figured this one out. There's
a 4th parameter to the method:
xmlrpc_server_call_method
And, the options are all explained on this page:
http://xmlrpc
All,
I get a fatal error when trying to create a new instance of a derived
class from within a static member which exists in the parent base
class. I think the problem is related to using this call:
new self();
Because the 'self' refers to the parent object and not the derived
class.
Chris wrote:
This gives the problem away..
http://www.php.net/manual/en/language.oop5.abstract.php
Any class that contains at least one abstract method must also be
abstract.
Make 'A' abstract:
abstract class A
Sorry for the poor example. I did catch that after submitting my post,
but it
René Fournier wrote:
Anyone find any good tutorials, code samples, etc. on such a thing?
Basically, I want to write server (in PHP) that listeners on a
particular port, and spins off a thread/process (essentially, execute
a separate script) for each incoming connection. There won't be a lot
So no matter what was actually typed, *I* would see:
function foo ($x) {
//body
}
but some heretic who doesn't know any better would see:
function foo($x)
{
//body
}
Now *THAT* would be a feature worth paying for in an IDE! :-)
Without caring what style you prefer, the correct
Gonzalo Monzón wrote:
Use Python, it is the way to go if you're willing to use mt :-)
I've already written the multi-threaded server using Java. I want to do
this in PHP, however, because the PHP threads can re-use PHP classes
I've already written and hence standardize on a single codebase
Jochem Maas wrote:
I've already written the multi-threaded server using Java. I want to
do this in PHP, however, because the PHP threads can re-use PHP
classes I've already written and hence standardize on a single
codebase and language. Many other languages have threads (Java, C#,
Python,
Stut wrote:
D. Dante Lorenso wrote:
IMHO, if your main goal is to allow your threaded app to reuse
existing PHP classes then your best bet is to investigate embedding
PHP into something written in C or C++.
This is a very good point. I have also been looking into the idea
pitched a few
Gonzalo Monzón wrote:
I've been developing desktop applications with PHP-GTK since 2002, far
beyond the web script context, and in the more complex projects I did,
was a must to implement multi-process and IPC communication due to the
lack of threading in PHP, as to deal with some issues like
All,
If I install PHP 5 and want to use a PECL extension, does that work the
same as if I install PHP 4 and try to use the same extension?
One extension that I use a lot is 'memcache' from PECL:
http://pecl.php.net/package/memcache
When I view this site, I do not see any reference to the
All,
For years I have wanted to have the ability to create a new Thread in
PHP similar to how it is done in the Java language. I understand the
complexities this would involve and have mentioned the idea to the PHP
internals list once and subsequently had the idea shot down and declared
not
Richard Lynch wrote:
On Wed, April 26, 2006 4:45 am, Kevin Davies wrote:
Obviously I need to convert these on entry, or on output into RSS.
Does anyone know of an easy way to do this, or is it a case of identifying
each unusual character individually?
You don't necessarily need to fix
All,
I'm trying to figure out which direction the PHP community is going when
it comes to an upload progress meter. I've just recently discovered the
ease of installing packages using PECL and see that this package is defined:
http://pecl.php.net/package/postparser
Yet, there does not
Richard Lynch wrote:
On Tue, April 25, 2006 12:18 pm, D. Dante Lorenso wrote:
I'm trying to figure out which direction the PHP community is going
when it comes to an upload progress meter.Since that meter would necessarily be
CLIENT side, the PHP community
is pretty much ignoring
Richard Lynch wrote:
On Tue, April 25, 2006 5:28 pm, D. Dante Lorenso wrote:
Everything PHP returns from a server is client side, so your
Oh yeah. I forgot to say...
The above presumption is patently false.
Let me clarify: Assuming client/server architecture, if PHP
Richard Lynch wrote:
Anything you see with PHP upload progress meter together has to
be some kind of hack whose under-pinning is NOT PHP at all, but is
JavaScript or similar client-side technology.
Not true. The graphical display is HTML, DHTML, JavaScript, etc...but
the means of monitoring
75 matches
Mail list logo