php-general Digest 30 Mar 2011 08:17:02 -0000 Issue 7250

2011-03-30 Thread php-general-digest-help

php-general Digest 30 Mar 2011 08:17:02 - Issue 7250

Topics (messages 312123 through 312137):

Re: Permission Denied - Help Requested
312123 by: Adam Richardson
312126 by: Ethan Rosenberg
312127 by: Al
312128 by: Ethan Rosenberg
312132 by: HallMarc Websites
312134 by: Adam Richardson
312135 by: Ethan Rosenberg
312136 by: Adam Richardson

Re: Resizing an image
312124 by: tedd
312137 by: Ross McKay

Re: Path question
312125 by: D. Dante Lorenso

[DEADLOCK - Code Igniter
312129 by: Tristan
312130 by: Daniel Brown
312131 by: Ashley Sheridan

Re: session variable problem
312133 by: markb

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 Mon, Mar 28, 2011 at 11:43 PM, Ethan Rosenberg wrote:

> At 11:14 PM 3/28/2011, Adam Richardson wrote:
>
>> On Mon, Mar 28, 2011 at 11:03 PM, Ethan Rosenberg <> eth...@earthlink.net>eth...@earthlink.net> wrote:
>> At 01:32 AM 3/28/2011, Hans Ã…hlin wrote:
>> Do you have SELinux installed?
>>
>> 2011/3/28 Ethan Rosenberg <
>> eth...@earthlink.net>:
>>
>> > Dear List -
>> >
>> > Thanks for all your help in the past. Â Here is another one...
>> >
>> > I am getting a Permission Denied" message when I try to run a PHP
>> script. Â I
>> > just changed the mode on the directory and the files to 777. Â This
>> problem
>> > arose when I changed the permissions. Â I thought I was solving a
>> problem,
>> > because I could not open a file for writing. Â I was not receiving error
>> > messages, but no file was created.
>> >
>> > Help and advice, please.
>> >
>> > Ethan Rosenberg
>> >
>> >
>> >
>> **
>> Â Hans Ã…hlin
>> Â Â  Tel: +46761488019
>> Â Â  icq: 275232967
>> Â Â  http://www.kronan-net.com/
>> Â Â  irc://irc.freenode.net:6667 - TheCoin
>>
>> **
>>
>>
>> Hans -
>>
>> Sorry, I did not include my signature, which includes all the requested
>> information.
>>
>> Here it is
>>
>> Ethan
>> ==
>> MySQL 5.1  PHP 5.3.3-6  Linux [Debian (sid)]
>>
>>
>> The problem persists.  I cannot write to a file from PHP.
>>
>> Any more suggestions?
>>
>> Thanks.
>>
>> Ethan
>>
>>
>> Hi Ethan,
>>
>> Are you using suPHP or suExec? I believe the server chokes on 777
>> permissions in those cases.
>>
>> Have you checked the permissions in the command line (sorry for the basic
>> question, but just making sure I know what you've already done?)
>>
>> Also, can we see some of the code you're using to handle the file
>> processing?
>>
>> Thanks,
>>
>> Adam
>>
>> --
>> Nephtali:  A simple, flexible, fast, and security-focused PHP framework
>> http://nephtaliproject.com
>>
>
> +
>
> Adam -
>
> Thanks.
>
>  1] Pardon my ignorance but I do not understand this - Are you using suPHP
>> or suExec?
>>
>
suPHP and suExec are two modules that allow PHP to run with the permissions
of the user, making it easy to write files to disk. However, suPHP (and I
believe suExec, but I can't remember for sure) does not like 777
permissions.




>
> 2] I changed the permissions to 755 and the "Permission Denied" message
> went away.
>

Check!




>
> 3] Have you checked the permissions in the command line? Yes
>

Check!




>
> 4] Here are some code snippets:
>
> $fptr1 = fopen("chessboard", "r+");  //this works
> $fptr2 = fopen('chessboard', 'w'); //this deletes the file, as it should
> for($i = 0; $i <8; $i++)
>{
>for ($j = 0; $j < 8; $j++)
>fprinf($fptr2, "%s ", $results[$i][$j]);
>fprinf($fptr2, "\n");
>
>} //this never writes, so I am left with an empty file


Can you try a simplified form that checks for success along the way? How
about something like the code below to see how far it gets (I haven't
tested, but it should be close):



What do you see if you run this?

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com
--- End Message ---
--- Begin Message ---

At 01:40 PM 3/29/2011, Adam Richardson wrote:

On Mon, Mar 28, 2011 at 11:43 PM, Ethan Rosenberg wrote:

> At 11:14 PM 3/28/2011, Adam Richardson wrote:
>
>> On Mon, Mar 28, 2011 at 11:03 PM, Ethan Rosenberg <> eth...@earthlink.net>eth...@earthlink.net> wrote:
>> At 01:32 AM 3/28/2011, Hans Åhlin wrote:
>> Do you have SELinux installed?
>>
>> 2011/3/28 Ethan Rosenberg <
>> eth...@earthlink.net>:
>>
>> > Dear List -
>> >
>> > Thanks for all your help in the past. Â Here 

php-general Digest 30 Mar 2011 22:46:04 -0000 Issue 7251

2011-03-30 Thread php-general-digest-help

php-general Digest 30 Mar 2011 22:46:04 - Issue 7251

Topics (messages 312138 through 312145):

Re: Path question
312138 by: Richard Quadling

Grasping class / controllers
312139 by: Aleksandar Skodric
312140 by: Ashley Sheridan
312141 by: Aleksandar Skodric

Re: Slow sessions.
312142 by: Rob Adams
312145 by: Bostjan Skufca

Re: Permission Denied - Help Requested - Solved
312143 by: Ethan Rosenberg

Session Variables - Error
312144 by: Ethan Rosenberg

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 29 March 2011 19:41, D. Dante Lorenso  wrote:
> 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 wrote about this a long time ago ... perhaps it might help:
>
> http://www.dantescode.com/2007/10/10/evolution-of-php-coder-naming-classes/
>
> Talks about putting your functions into classes and using the autoloader to
> avoid putting include statements in your code.
>
> Might not help if you are loading content which is not just PHP
> functions/code, but if you haven't "evolved" this far yet, the read might
> help you out.
>
> -- Dante
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

The Zend Framework documentation has some notes regarding of
autoloading of resources.

http://framework.zend.com/manual/en/learning.autoloading.resources.html

You may find some mileage there.



-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--- End Message ---
--- Begin Message ---

Hi all,

I am using Codeigniter framework, tho' I believe my question is more PHP 
related in general.


Problem I am having is following.

Codeigniter (CI) uses general class CI_Controller for all functions.
I have extended this controller with: abstract class CORE_Controller 
extends CI_Controller {...}.


Then, I also have a RESTFul library which is:
class Cpin2_rest {}

And, last one is Ion Auth library which states:
class Ion_auth {}

In the Ion auth, there (should be) is initialization of CI_Controller with:

$this->ci =& get_instance();

However, $this->ci inherits Cpin2_rest instead of CI_Controller (or 
CORE_Controller).


I really have no idea where have I made a mistake and can't get around 
this one :(


Any help is appreciated!

Thanks!
Aleks
--- End Message ---
--- Begin Message ---
"Aleksandar Skodric"  wrote:

>Hi all,
>
>I am using Codeigniter framework, tho' I believe my question is more
>PHP
>related in general.
>
>Problem I am having is following.
>
>Codeigniter (CI) uses general class CI_Controller for all functions.
>I have extended this controller with: abstract class CORE_Controller
>extends CI_Controller {...}.
>
>Then, I also have a RESTFul library which is:
>class Cpin2_rest {}
>
>And, last one is Ion Auth library which states:
>class Ion_auth {}
>
>In the Ion auth, there (should be) is initialization of CI_Controller
>with:
>
>$this->ci =& get_instance();
>
>However, $this->ci inherits Cpin2_rest instead of CI_Controller (or
>CORE_Controller).
>
>I really have no idea where have I made a mistake and can't get around
>this one :(
>
>Any help is appreciated!
>
>Thanks!
>Aleks
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


That's completely CodeIgniter, not php. The mvc framework layout is something 
used by many languages, but questions about the framework aren't questions you 
should ask of the language but the framework.


Thanks
Ash
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
--- End Message ---
--- Begin Message ---

Hi,

Yes indeed you are correct.
Found out that framework was loading libraries from array in specific 
order, whereby one overrules the next one.


Anyway, problem solved by rearranging the order of the array :)

Thanks anyway :)

On 03/30/2011 04:13 PM, Ashley Sheridan wrote:

"Aleksandar Skodric"  wrote:


Hi all,

I am using Codeigniter framework, tho' I believe my question is more
PHP
related in general.

Problem I am having is following.

Codeigniter (CI) uses general class CI_Controller for all functions.
I have extended this controller with: abstract class CORE_Controller
extends CI_Controller {...}.

Then, I also have a RESTFul library which is:
class Cpin2_rest {}

And, last one is Ion Auth library which states:
class Ion_auth {}

In the Ion auth, there (should be) is initia