|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 7 Aug 2005 12:58:29 -0000 Issue 3611
php-general-digest-help
lists.php.net
Date: Sun Aug 07 2005 - 07:58:29 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 7 Aug 2005 12:58:29 -0000 Issue 3611
Topics (messages 220151 through 220169):
Re: sorry for asking here,a small apache query
220151 by: Alan Milnes
Fast count of recordset in php...
220152 by: Gustav Wiberg
220153 by: Matt Darby
220155 by: Sebastian
220164 by: TalkativeDoggy
220165 by: TalkativeDoggy
220168 by: Gustav Wiberg
Re: [PHP-DEV] Re: [PHP] Exceptions: function x throws Exception
220154 by: Marcus Boerger
220159 by: Jochem Maas
Re: PHP 5.0.4 on AMD64
220156 by: Joseph Oaks
PHP 4.3.9 - Undefined variable: authed in
220157 by: Trevor Tregoweth
220158 by: Jochem Maas
Re: varibles defination
220160 by: Jochem Maas
Re: Average time spent on a page
220161 by: M Saleh EG
mkdir, Shared Hosting?
220162 by: Esteamedpw.aol.com
220163 by: Robbert van Andel
220166 by: Esteamedpw.aol.com
220167 by: Burhan Khalid
Re: Java - toString() <-> php - ?
220169 by: Rory Browne
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
babu wrote:
>Hi all,
>
>I am sorry for asking in php forum.i am subscribed to php and not to apache.but i hope many people in this group also the solution to this query.
>
If you know you are in wrong place why ask here?
Alan
attached mail follows:
Hello there!
How do i get a fast count of a recordset in php?
Look at this code:
$sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE
'$checkLev%'";
$querys = mysql_query($sql);
//Count products in db
//
$dbArray = mysql_fetch_array($querys);
$nrOfProducts = $dbArray["cn"];
It's slow... Why? Any suggestions?
/mr G
varupiraten.se
attached mail follows:
$num=mysql_num_rows($sql);
Gustav Wiberg wrote:
> Hello there!
>
> How do i get a fast count of a recordset in php?
>
> Look at this code:
>
> $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE
> '$checkLev%'";
> $querys = mysql_query($sql);
>
> //Count products in db
> //
> $dbArray = mysql_fetch_array($querys);
> $nrOfProducts = $dbArray["cn"];
>
>
> It's slow... Why? Any suggestions?
>
> /mr G
>
varupiraten.se
>
attached mail follows:
you'd be suprized how fast an index can be.. you should read the manual
on indexes,
http://dev.mysql.com/doc/mysql/en/mysql-indexes.html
"If a table has 1,000 rows, this is at least 100 times faster than
reading sequentially"
while you may not get 100x faster, it will be faster than having no
index.. also try using mysql_num_rows()
$sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE
'$checkLev%'");
// record count
echo mysql_num_rows($sql);
PS, 'reply all' to list.
Gustav Wiberg wrote:
> Hi there!
>
> There are about 300 records.
> You're right, I can add an index, but Is that the only way to get a
> faster solution?
>
> /mr G
>
varupiraten.se
>
> ----- Original Message ----- From: "Sebastian"
> <sebastian
broadbandgaming.net>
> To: "Gustav Wiberg" <gustav
varupiraten.se>
> Sent: Saturday, August 06, 2005 11:08 PM
> Subject: Re: [PHP] Fast count of recordset in php...
>
>
>> how many records in the table? its going to be slow no matter what,
>> especially if you have a lot of records.. your searching each record
>> then counting them.. do you have any indexes? judging by your query
>> you can add index on Varunamn and it should be more speedy..
>>
>> Gustav Wiberg wrote:
>>
>>> Hello there!
>>>
>>> How do i get a fast count of a recordset in php?
>>>
>>> Look at this code:
>>>
>>> $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE
>>> '$checkLev%'";
>>> $querys = mysql_query($sql);
>>>
>>> //Count products in db
>>> //
>>> $dbArray = mysql_fetch_array($querys);
>>> $nrOfProducts = $dbArray["cn"];
>>>
>>>
>>> It's slow... Why? Any suggestions?
>>>
>>> /mr G
>>>
varupiraten.se
>>>
>>
>>
>> --
>> No virus found in this outgoing message.
>> Checked by AVG Anti-Virus.
>> Version: 7.0.338 / Virus Database: 267.10.1/64 - Release Date: 8/4/2005
>>
>>
>>
>> --
>> No virus found in this incoming message.
>> Checked by AVG Anti-Virus.
>> Version: 7.0.338 / Virus Database: 267.10.0/63 - Release Date:
>> 2005-08-03
>>
>>
>
>
>
>
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.1/64 - Release Date: 8/4/2005
attached mail follows:
if you just wana get count of recordset,
don't do this:
$sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE
'$checkLev%'");
// record count
echo mysql_num_rows($sql);
be coz this way is slow and costs more overload.
$sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE
'$checkLev%'";
$querys = mysql_query($sql);
//Count products in db
//
$dbArray = mysql_fetch_row($querys);
$nrOfProducts = $dbArray[0];
Sebastian wrote:
> you'd be suprized how fast an index can be.. you should read the manual
> on indexes,
> http://dev.mysql.com/doc/mysql/en/mysql-indexes.html
>
> "If a table has 1,000 rows, this is at least 100 times faster than
> reading sequentially"
>
> while you may not get 100x faster, it will be faster than having no
> index.. also try using mysql_num_rows()
>
> $sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE
> '$checkLev%'");
> // record count
> echo mysql_num_rows($sql);
>
>
> PS, 'reply all' to list.
>
> Gustav Wiberg wrote:
>
>> Hi there!
>>
>> There are about 300 records.
>> You're right, I can add an index, but Is that the only way to get a
>> faster solution?
>>
>> /mr G
>>
varupiraten.se
>>
>> ----- Original Message ----- From: "Sebastian"
>> <sebastian
broadbandgaming.net>
>> To: "Gustav Wiberg" <gustav
varupiraten.se>
>> Sent: Saturday, August 06, 2005 11:08 PM
>> Subject: Re: [PHP] Fast count of recordset in php...
>>
>>
>>> how many records in the table? its going to be slow no matter what,
>>> especially if you have a lot of records.. your searching each record
>>> then counting them.. do you have any indexes? judging by your query
>>> you can add index on Varunamn and it should be more speedy..
>>>
>>> Gustav Wiberg wrote:
>>>
>>>> Hello there!
>>>>
>>>> How do i get a fast count of a recordset in php?
>>>>
>>>> Look at this code:
>>>>
>>>> $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE
>>>> '$checkLev%'";
>>>> $querys = mysql_query($sql);
>>>>
>>>> //Count products in db
>>>> //
>>>> $dbArray = mysql_fetch_array($querys);
>>>> $nrOfProducts = $dbArray["cn"];
>>>>
>>>>
>>>> It's slow... Why? Any suggestions?
>>>>
>>>> /mr G
>>>>
varupiraten.se
attached mail follows:
if you just wana get count of recordset,
don't do this:
$sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE
'$checkLev%'");
// record count
echo mysql_num_rows($sql);
be coz this way is slow and costs more overload.
$sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE
'$checkLev%'";
$querys = mysql_query($sql);
//Count products in db
//
$dbArray = mysql_fetch_row($querys);
$nrOfProducts = $dbArray[0];
Sebastian wrote:
> you'd be suprized how fast an index can be.. you should read the manual
> on indexes,
> http://dev.mysql.com/doc/mysql/en/mysql-indexes.html
>
> "If a table has 1,000 rows, this is at least 100 times faster than
> reading sequentially"
>
> while you may not get 100x faster, it will be faster than having no
> index.. also try using mysql_num_rows()
>
> $sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE
> '$checkLev%'");
> // record count
> echo mysql_num_rows($sql);
>
>
> PS, 'reply all' to list.
>
> Gustav Wiberg wrote:
>
>> Hi there!
>>
>> There are about 300 records.
>> You're right, I can add an index, but Is that the only way to get a
>> faster solution?
>>
>> /mr G
>>
varupiraten.se
>>
>> ----- Original Message ----- From: "Sebastian"
>> <sebastian
broadbandgaming.net>
>> To: "Gustav Wiberg" <gustav
varupiraten.se>
>> Sent: Saturday, August 06, 2005 11:08 PM
>> Subject: Re: [PHP] Fast count of recordset in php...
>>
>>
>>> how many records in the table? its going to be slow no matter what,
>>> especially if you have a lot of records.. your searching each record
>>> then counting them.. do you have any indexes? judging by your query
>>> you can add index on Varunamn and it should be more speedy..
>>>
>>> Gustav Wiberg wrote:
>>>
>>>> Hello there!
>>>>
>>>> How do i get a fast count of a recordset in php?
>>>>
>>>> Look at this code:
>>>>
>>>> $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE
>>>> '$checkLev%'";
>>>> $querys = mysql_query($sql);
>>>>
>>>> //Count products in db
>>>> //
>>>> $dbArray = mysql_fetch_array($querys);
>>>> $nrOfProducts = $dbArray["cn"];
>>>>
>>>>
>>>> It's slow... Why? Any suggestions?
>>>>
>>>> /mr G
>>>>
varupiraten.se
attached mail follows:
Hi again!
Thanx!!! I think this will help a lot!!!
/mr G
varupiraten.se
----- Original Message -----
From: "TalkativeDoggy" <talkativedoggy
gmail.com>
To: "Sebastian" <sebastian
broadbandgaming.net>
Cc: "Gustav Wiberg" <gustav
varupiraten.se>; <php-general
lists.php.net>
Sent: Sunday, August 07, 2005 6:04 AM
Subject: Re: [PHP] Fast count of recordset in php...
> if you just wana get count of recordset,
> don't do this:
> $sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE
> '$checkLev%'");
> // record count
> echo mysql_num_rows($sql);
>
> be coz this way is slow and costs more overload.
>
> $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE
> '$checkLev%'";
> $querys = mysql_query($sql);
>
> //Count products in db
> //
> $dbArray = mysql_fetch_row($querys);
> $nrOfProducts = $dbArray[0];
>
> Sebastian wrote:
>> you'd be suprized how fast an index can be.. you should read the manual
>> on indexes,
>> http://dev.mysql.com/doc/mysql/en/mysql-indexes.html
>>
>> "If a table has 1,000 rows, this is at least 100 times faster than
>> reading sequentially"
>>
>> while you may not get 100x faster, it will be faster than having no
>> index.. also try using mysql_num_rows()
>>
>> $sql = mysql_query("SELECT col FROM tbvara WHERE Varunamn LIKE
>> '$checkLev%'");
>> // record count
>> echo mysql_num_rows($sql);
>>
>>
>> PS, 'reply all' to list.
>>
>> Gustav Wiberg wrote:
>>
>>> Hi there!
>>>
>>> There are about 300 records.
>>> You're right, I can add an index, but Is that the only way to get a
>>> faster solution?
>>>
>>> /mr G
>>>
varupiraten.se
>>>
>>> ----- Original Message ----- From: "Sebastian"
>>> <sebastian
broadbandgaming.net>
>>> To: "Gustav Wiberg" <gustav
varupiraten.se>
>>> Sent: Saturday, August 06, 2005 11:08 PM
>>> Subject: Re: [PHP] Fast count of recordset in php...
>>>
>>>
>>>> how many records in the table? its going to be slow no matter what,
>>>> especially if you have a lot of records.. your searching each record
>>>> then counting them.. do you have any indexes? judging by your query
>>>> you can add index on Varunamn and it should be more speedy..
>>>>
>>>> Gustav Wiberg wrote:
>>>>
>>>>> Hello there!
>>>>>
>>>>> How do i get a fast count of a recordset in php?
>>>>>
>>>>> Look at this code:
>>>>>
>>>>> $sql = "SELECT COUNT(IDVara) cn FROM tbvara WHERE Varunamn LIKE
>>>>> '$checkLev%'";
>>>>> $querys = mysql_query($sql);
>>>>>
>>>>> //Count products in db
>>>>> //
>>>>> $dbArray = mysql_fetch_array($querys);
>>>>> $nrOfProducts = $dbArray["cn"];
>>>>>
>>>>>
>>>>> It's slow... Why? Any suggestions?
>>>>>
>>>>> /mr G
>>>>>
varupiraten.se
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.338 / Virus Database: 267.10.0/63 - Release Date: 2005-08-03
>
>
attached mail follows:
Hello Jochem,
lookup the archieves. We have long ago decided agains that.
marcus
Friday, August 5, 2005, 2:26:04 PM, you wrote:
> Dear Internals,
> class FooBar { public function foo() throws Exception {} }
> function fooFoo() throws Exception {}
> this came up on php-generals and I wondered if anyone had time/cared
> to comment if it (as it does to me) seems like a good idea and/or whether it is
> technically feasable. My thinking was that one could then use the reflection API
> to determine whether functions/methods are capable of throwing exceptions and or
> what kind - might be quite handy when using third party apps/classes
> (PEAR springs to mind.)
> thanks and regards,
> Jochem
> <the rest is blabla aimed at php-generals>
> Torgny Bjers wrote:
>> Norbert Wenzel wrote:
>>
>>>If there is a class with a function, that might throw exceptions and
>>>does NOT catch them, may I write that like in Java?
>>>
>>>class FooClass {
>>>
>>> public function foo() throws Exception {
> think about this, especially in terms of the Reflection API, it sounds
> like a really good idea (at least to me)
>>>
>>> }
>>>
>>>}
>>>
>>>Or is there another possibility to tell a function throws an exception
>>>and to force the caller to handle that exception?
>>>
>>>thanks in advance,
>>>
>>>Norbert
>>>
>>
>>
>> Hello Norbert,
>>
>> The Java way doesn't work here. The best approach would be to simply run
>> a try/catch/finally around the call to your function/method, and inside
>> the function itself you do the following:
>>
>> if (...) { throw new Exception("My message."); } }
>>
> indeed - bottom line is you have to know that a function/method/extension may
> throw. mostly you do know because:
> 1. you wrote the code,
> 2. or it's documented in the extension manual pages
> 3. and/ro you hit an unacaught exception whilst developing.
> my approach to cover any oversights is to wrap every thing in a main try/catch block
> just in case - keeping in mind that the idea is that this 'main' catch block is never run
> is al goes well.
>> Regards,
>> Torgny
>>
Best regards,
Marcus
attached mail follows:
Marcus Boerger wrote:
> Hello Jochem,
>
> lookup the archieves. We have long ago decided agains that.
I'll take your word on it. :-) (shame on me for not searching harder
before asking)
thanks for replying.
>
> marcus
>
> Friday, August 5, 2005, 2:26:04 PM, you wrote:
>
>
>>Dear Internals,
>
>
>>class FooBar { public function foo() throws Exception {} }
>>function fooFoo() throws Exception {}
>
>
>> this came up on php-generals and I wondered if anyone had time/cared
>>to comment if it (as it does to me) seems like a good idea and/or whether it is
>>technically feasable. My thinking was that one could then use the reflection API
>>to determine whether functions/methods are capable of throwing exceptions and or
>>what kind - might be quite handy when using third party apps/classes
>>(PEAR springs to mind.)
>
>
>>thanks and regards,
>>Jochem
>
>
>
>><the rest is blabla aimed at php-generals>
>
>
>>Torgny Bjers wrote:
>>
>>>Norbert Wenzel wrote:
>>>
>>>
>>>>If there is a class with a function, that might throw exceptions and
>>>>does NOT catch them, may I write that like in Java?
>>>>
>>>>class FooClass {
>>>>
>>>> public function foo() throws Exception {
>
>
>>think about this, especially in terms of the Reflection API, it sounds
>>like a really good idea (at least to me)
>
>
>>>> }
>>>>
>>>>}
>>>>
>>>>Or is there another possibility to tell a function throws an exception
>>>>and to force the caller to handle that exception?
>>>>
>>>>thanks in advance,
>>>>
>>>>Norbert
>>>>
>>>
>>>
>>>Hello Norbert,
>>>
>>>The Java way doesn't work here. The best approach would be to simply run
>>>a try/catch/finally around the call to your function/method, and inside
>>>the function itself you do the following:
>>>
>>>if (...) { throw new Exception("My message."); } }
>>>
>
>
>>indeed - bottom line is you have to know that a function/method/extension may
>>throw. mostly you do know because:
>
>
>>1. you wrote the code,
>>2. or it's documented in the extension manual pages
>>3. and/ro you hit an unacaught exception whilst developing.
>
>
>>my approach to cover any oversights is to wrap every thing in a main try/catch block
>>just in case - keeping in mind that the idea is that this 'main' catch block is never run
>>is al goes well.
>
>
>>>Regards,
>>>Torgny
>>>
>
>
>
>
>
> Best regards,
> Marcus
>
attached mail follows:
that chcon did the trick, thanks.
Joe
Joseph Oaks (trell
trells.com) wrote:
>
> Thanks, I will give that a try, and let you know.
>
> Joe
>
> Holografix (holografix
gmail.com) wrote:
> >
> > Hi
> >
> > Take a look here: http://forums.fedoraforum.org/showthread.php?t=59163
> >
> > I had that problem too.
> >
> > Regards
> > holografix
> >
> >
> > ""Joseph Oaks"" <trell
trells.com> escreveu na mensagem
> > news:20050805.Td6.66325500
webmail.trells.com...
> > > So, heres the deal, I'm running Fedora Core 3 on an dual proc AMD64
> > > system.
> > >
> > > I have compiled Apache 2.0.54, and PHP 5.0.4, when I try to start apache
> > > I am given an error. The error is as follows...
> > >
> > > [root
hal1 conf]# /etc/rc.d/init.d/httpd start
> > > Starting httpd: Syntax error on line 24 of
> > > /opt/apache-2.0.54/conf/httpd.conf:
> > > Cannot load /opt/apache-2.0.54/modules/libphp5.so into server:
> > > /opt/apache-2.0.54/modules/libphp5.so: cannot restore segment prot after
> > > reloc:
> > > Permission denied
> > >
> > > The only thing I'm finding on google is about /usr/lib64 well I don't have
> > > a
> > > /usr/lib64, its just /usr/lib so that can't be the issue.
> > >
> > > Any suggestion would be appreciated.
> > > thanks
> > >
> > > Joe
> > >
> > > --
> > > "Computers are like air conditioners - they stop working properly when you
> > > open Windows"
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> "Computers are like air conditioners - they stop working properly when you
> open Windows"
>
>
>
>
--
"Computers are like air conditioners - they stop working properly when you
open Windows"
attached mail follows:
Hi There
I am trying to run a simple password /php / mysql script for a web page and
get the following errors, it works fine on a earlier versions of php / mysql
PHP Notice: Undefined variable: help_out_uid in
/var/www/html/lcc/secure/secure.php on line 87,
PHP Notice: Undefined variable: authed in
/var/www/html/lcc/secure/secure.php on line 34
mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)
PHP 4.3.9 (cgi) (built: Oct 20 2004 14:52:04)
Thanks for you help
Trevor
attached mail follows:
Trevor Tregoweth wrote:
> Hi There
>
>
point 1: you started a new thread by replying to an existing thread - BAD.
point 2: the errors (notices) are telling you something. read them.
if you don't understand them, try google first, then php.net
hint: your php config has changed - error reporting has been set
to also show E_NOTICE level errors. change it back and you won't see
them any more (they were alway there btw). e.g.
error_reporting( error_reporting() & ^E_NOTICE ); // don't show notices
or set display_errors ini directive in php.ini
> I am trying to run a simple password /php / mysql script for a web page and
> get the following errors, it works fine on a earlier versions of php / mysql
>
>
> PHP Notice: Undefined variable: help_out_uid in
> /var/www/html/lcc/secure/secure.php on line 87,
>
> PHP Notice: Undefined variable: authed in
> /var/www/html/lcc/secure/secure.php on line 34
>
> mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)
>
> PHP 4.3.9 (cgi) (built: Oct 20 2004 14:52:04)
>
>
>
> Thanks for you help
>
> Trevor
>
attached mail follows:
edwardspl
ita.org.mo wrote:
>>>How can we define and display the varibles by using for loop
>>>function ?
>>
>><?php
>>for ($x=0;$x<10;$x++){
>> $func[$x]=$x;
>>}
>>print_r($func);
>>?>
>
>
> If I want to define a set of varibles ( two dimension array, eg : $func[0,0] )
$func[0,0] is not valid syntax. you mean $func[0][0]
> and via the varibles of form tag ( format, eg : $_GET["varname"] or
> $_POST["varname"] )...
> How about the example ?
watch what happen to $_POST when you stick these fields in your form
and submit it:
<input type="text" value="a" name="test[a]" />
<input type="text" value="b" name="test[b]" />
<input type="text" value="c" name="test[c]" />
<input type="text" value="d1" name="test[d][]" />
<input type="text" value="d2" name="test[d][]" />
>
> Edward.
>
attached mail follows:
Try using one of the log reader/analysis packages available for Apache or
try doing it urself.
Are you looking for the algorithm? let me know.
On 8/6/05, virtualsoftware
gmail.com <virtualsoftware
gmail.com> wrote:
>
> LOL. This got nothing to do with my question . LOL again
>
> ----- Original Message -----
> From: "Frank de Bot" <php
searchy.nl>
> Cc: <php-general
lists.php.net>
> Sent: Saturday, August 06, 2005 10:20 PM
> Subject: Re: [PHP] Average time spent on a page
>
>
> > virtualsoftware
gmail.com wrote:
> >
> >>Hi,
> >>
> >>How can i found out the average time users spent on a page. Anyone know
> a
> >>tutorial?
> >>
> >>Thanks in advance for your help !!!
> >>
> >
> > A hello world page will take me around 15 secs I guess...
> > A full blown website with everything you can imagine a few months orso.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
M.Saleh.E.G
97150-4779817
attached mail follows:
Hi,
I'm using Shared Hosting and I was told - then I learned from trial and
error - that you can't use mkdir on Shared Hosting... is this *100%* true?
is
there a way around it?
I get:
Warning: mkdir(/home/***/public_html/test/): Permission denied in
/home/***/public_html/test.php on line 3
So, again, is there any possible way around this? I've Googled, read the
manual but it seems that If I don't get an Error - I get nothing at all,
including the directory.
Thanks for any help!
- Clint
attached mail follows:
As far as I know, it's not a shared hosting issue, but a permission issue.
The site admin has not given the user under which your php scripts run
permission to create directories and most likely files and other file system
operations. It's a security issue.
Robbert
-----Original Message-----
From: Esteamedpw
aol.com [mailto:Esteamedpw
aol.com]
Sent: Saturday, August 06, 2005 8:53 PM
To: php-general
lists.php.net
Subject: [PHP] mkdir, Shared Hosting?
Hi,
I'm using Shared Hosting and I was told - then I learned from trial and
error - that you can't use mkdir on Shared Hosting... is this *100%* true?
is
there a way around it?
I get:
Warning: mkdir(/home/***/public_html/test/): Permission denied in
/home/***/public_html/test.php on line 3
So, again, is there any possible way around this? I've Googled, read the
manual but it seems that If I don't get an Error - I get nothing at all,
including the directory.
Thanks for any help!
- Clint
attached mail follows:
In a message dated 8/6/2005 10:59:44 P.M. Central Standard Time,
php
swimwebs.com writes:
As far as I know, it's not a shared hosting issue, but a permission issue.
The site admin has not given the user under which your php scripts run
permission to create directories and most likely files and other file system
operations. It's a security issue.
Robbert
I see... I guess I could ask to see if I could get permission to do so then?
lol never hurts to ask :)
Thanks,
Clint
attached mail follows:
Esteamedpw
aol.com wrote:
>
> In a message dated 8/6/2005 10:59:44 P.M. Central Standard Time,
> php
swimwebs.com writes:
>
> As far as I know, it's not a shared hosting issue, but a permission issue.
> The site admin has not given the user under which your php scripts run
> permission to create directories and most likely files and other file system
> operations. It's a security issue.
>
> Robbert
>
>
>
> I see... I guess I could ask to see if I could get permission to do so then?
> lol never hurts to ask :)
Open up your FTP client and log into your website, then change the
permissions on your folder so that the apache process has write access
to it. Its really hit and miss depending on your setup.
The sure fire way (but highly insecure) way is to change the permissions
to the directory in question to 777.
A better solution would be 755, but it may not work.
Try it, and see what you get.
attached mail follows:
Um - did you read my last email regarding var_dump var_export and print_r
Did you try them?
Do they do what you want?
On 8/2/05, Adi Zebic <adi
beeznest.net> wrote:
> Rory Browne a écrit :
> > I haven't a monkies what that code(your java) does, and I don't have
> > time to analyse it(in expensive cybercafe), but you may want to
> > consider www.php.net/print-r www.php.net/var-dump and
> > www.php.net/var-export
> >
> > I think they may do what you want without using the toString method,
> > which for what you're describing is basicly an ugly hack.
> >
> > One more thing: Enlighten me: What exactly do you mean by "live
> > evolution" in your php/java context.
>
> If in php context you have class, say, A:
>
> class A
> {
>
> var $t1;
> var $t2;
> var $t3;
>
> //After, you have object contructor of type A
> //we have something like this
>
> function A ($var1, $var2, $var3)
> {
> $this -> t1 = $var1;
> $this -> t2 = $var2;
> $this -> t3 = $var3;
> }
>
> ....some other code
> }
>
> //than in some other class we have something like this:
>
> class someOtherClass
> {
> $aConstructor = new A(1,2,3);
> //values of t1, t2 and t3 are 1,2 and 3 now
> }
>
> Right? yes.
>
> How you can you do something like this inside of "someOtherClass"
>
> print ($aConstructor);
>
> to finally have some nice output like
> Value of t1 is 1;
> Value of t2 is 2;
> Value of T3 is 3;
>
> or just:
>
> 1
> 2
> 3
>
> Without creating functions like getValues()
>
> function getValues()
> {
> print ($this -> t1);
> print ($this -> t2);
> print ($this -> t3);
> }
>
> and after explicit invoke function:
>
> $aConstructor -> getValues();
>
> So, what I want is
> this: print ($aConstructor);
>
> and not this:
>
> $aContructor -> getValues();
>
> Am I clear :-)
>
>
> ADI
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]