Mailing List Archive

DAViCal cPanal Installation Problems
Hi! I've been trying to install DAViCal on a hosted cPanel server and hit upon
a couple of problems. Searching around I found an earlier post
http://lists.morphoss.com/pipermail/davical-dev/2009/000006.html
which regrettably doesn't shed any light on my issues.

I've blogged my installation process - I am effectively porting DAViCal from
my openSUSE 11.2 box to the cPanel host. The blog is at (KMail bug may split
the link)
http://www.badzilla.co.uk/Migration-localhost-DAViCal-server-Hosted-cPanel-
Solution

I have two problems. To avoid cluttering this mail list I have provided links
to screen images and error logs.

PROBLEM 1
When I create a new principal (say a Resource) and then try to list all the
resources, the latest resource is not listed. In my example, I create a
resource called "F1"
Screen image and trace log at http://www.badzilla.co.uk/content/DAViCal-Dump1

Now when I click on 'Name' to reorder the column, the new resource appears!
Screen image and trace log at http://www.badzilla.co.uk/content/DAViCal-Dump2

If I subsequently go back into that screen, the resource disappears again.

Any idea why that would be the case? This happens with users, resources and
groups.

PROBLEM 2
When a client attempts to subscribe to a collection I am getting an Invalid
URL diagnostic.

Screen image and trace log at http://www.badzilla.co.uk/content/DAViCal-Dump3
Perhaps the most pertinent bit may be the line at the end:
PHP Fatal error: Cannot redeclare apache_request_headers()

Any help in solving these problems gratefully received!

Cheers!
--

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.morphoss.com/pipermail/davical-users/attachments/20100412/495ee6d9/attachment.htm>
-------------- next part --------------
DAViCal cPanal Installation Problems [ In reply to ]
On Mon, 2010-04-12 at 18:31 +0100, Badzilla wrote:
> Hi! I've been trying to install DAViCal on a hosted cPanel server and
> hit upon a couple of problems. Searching around I found an earlier
> post
>
> http://lists.morphoss.com/pipermail/davical-dev/2009/000006.html
>
> which regrettably doesn't shed any light on my issues.
>
> I've blogged my installation process - I am effectively porting
> DAViCal from my openSUSE 11.2 box to the cPanel host. The blog is at
> (KMail bug may split the link)
>
> http://www.badzilla.co.uk/Migration-localhost-DAViCal-server-Hosted-cPanel-Solution
>
> I have two problems. To avoid cluttering this mail list I have
> provided links to screen images and error logs.
>
> PROBLEM 1
>
> When I create a new principal (say a Resource) and then try to list
> all the resources, the latest resource is not listed. In my example, I
> create a resource called "F1"
>
> Screen image and trace log at
> http://www.badzilla.co.uk/content/DAViCal-Dump1
>
> Now when I click on 'Name' to reorder the column, the new resource
> appears!
>
> Screen image and trace log at
> http://www.badzilla.co.uk/content/DAViCal-Dump2
>
> If I subsequently go back into that screen, the resource disappears
> again.

I get Access Denied on at least the first of those URLs.

> Any idea why that would be the case? This happens with users,
> resources and groups.

Is it possible that they are being created as 'Inactive'?

Can you query the database and see that the records really are there?

e.g. something like:

psql davical -c "SELECT * FROM dav_principal WHERE username = 'andrew'"


> PROBLEM 2
>
> When a client attempts to subscribe to a collection I am getting an
> Invalid URL diagnostic.
>
> Screen image and trace log at
> http://www.badzilla.co.uk/content/DAViCal-Dump3
>
> Perhaps the most pertinent bit may be the line at the end:
>
> PHP Fatal error: Cannot redeclare apache_request_headers()

Yeah, that sounds very odd. The AWLUtilties.php (part of libawl-php)
tries to define an alternative for this routine, for circumstances where
it does not exist already, but it wraps that in a !function_exists()
call.

Is it possible that your hosting provider is not allowing
function_exists() calls in some way? You could resolve this by removing
the block from that file and seeing if that fixes the problem.


> Any help in solving these problems gratefully received!

Good luck!

I know every time I've ever tried to do this stuff with hosting
providers that don't hand out root access I've run into all sorts of
problems with crappy old versions of PHP, or PostgreSQL, or missing
modules for this, that and the other thing, that really make it a pain.

My recommendation is to stick to simple no-nonsense providers like
HostVirtual or SliceHost who just provide a virtual machine and I can do
as I please, and then I please myself and stick Debian on there.

Obviously there are reasons why that's not always going to work, but it
works well for me :-)

Cheers,
Andrew.

------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
You are a very redundant person, that's what kind of person you are.
------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.morphoss.com/pipermail/davical-users/attachments/20100413/47b1322a/attachment.pgp>
-------------- next part --------------
DAViCal cPanal Installation Problems [ In reply to ]
On Tuesday 13 Apr 2010 12:15:29 Andrew McMillan wrote:
> On Mon, 2010-04-12 at 18:31 +0100, Badzilla wrote:
> > Hi! I've been trying to install DAViCal on a hosted cPanel server and
> > hit upon a couple of problems. Searching around I found an earlier
> > post
> >
> > http://lists.morphoss.com/pipermail/davical-dev/2009/000006.html
> >
> > which regrettably doesn't shed any light on my issues.
> >
> > I've blogged my installation process - I am effectively porting
> > DAViCal from my openSUSE 11.2 box to the cPanel host. The blog is at
> > (KMail bug may split the link)
> >
> > http://www.badzilla.co.uk/Migration-localhost-DAViCal-server-Hosted-cPane
> >l-Solution
> >
> > I have two problems. To avoid cluttering this mail list I have
> > provided links to screen images and error logs.
> >
> > PROBLEM 1
> >
> > When I create a new principal (say a Resource) and then try to list
> > all the resources, the latest resource is not listed. In my example, I
> > create a resource called "F1"
> >
> > Screen image and trace log at
> > http://www.badzilla.co.uk/content/DAViCal-Dump1
> >
> > Now when I click on 'Name' to reorder the column, the new resource
> > appears!
> >
> > Screen image and trace log at
> > http://www.badzilla.co.uk/content/DAViCal-Dump2
> >
> > If I subsequently go back into that screen, the resource disappears
> > again.
>
> I get Access Denied on at least the first of those URLs.
>

I've fixed that. Forgot to publish the first error log page, but the others
were ok.

> > Any idea why that would be the case? This happens with users,
> > resources and groups.
>
> Is it possible that they are being created as 'Inactive'?
>
> Can you query the database and see that the records really are there?
>
> e.g. something like:
>
> psql davical -c "SELECT * FROM dav_principal WHERE username = 'andrew'"
>


No, they are being created ok. Here's something weird though.
1. I create a new principal, it doesn't show up when I list principals;
2. It DOES show up when I reorder the columns;
3. It DOESN'T show up when I then go back into the same screen;
4. Here's the kicker: The following day everything is ok and the principal
DOES show up in the list.

So, what do you reckon? I don't know enough about PostgreSQL - but could there
be a buffering / commit problem here?

> > PROBLEM 2
> >
> > When a client attempts to subscribe to a collection I am getting an
> > Invalid URL diagnostic.
> >
> > Screen image and trace log at
> > http://www.badzilla.co.uk/content/DAViCal-Dump3
> >
> > Perhaps the most pertinent bit may be the line at the end:
> >
> > PHP Fatal error: Cannot redeclare apache_request_headers()
>
> Yeah, that sounds very odd. The AWLUtilties.php (part of libawl-php)
> tries to define an alternative for this routine, for circumstances where
> it does not exist already, but it wraps that in a !function_exists()
> call.
>
> Is it possible that your hosting provider is not allowing
> function_exists() calls in some way? You could resolve this by removing
> the block from that file and seeing if that fixes the problem.
>
> > Any help in solving these problems gratefully received!
>
> Good luck!
>
> I know every time I've ever tried to do this stuff with hosting
> providers that don't hand out root access I've run into all sorts of
> problems with crappy old versions of PHP, or PostgreSQL, or missing
> modules for this, that and the other thing, that really make it a pain.
>
> My recommendation is to stick to simple no-nonsense providers like
> HostVirtual or SliceHost who just provide a virtual machine and I can do
> as I please, and then I please myself and stick Debian on there.
>
> Obviously there are reasons why that's not always going to work, but it
> works well for me :-)
>
> Cheers,
> Andrew.

I've got this working. But the solution has me scratching my head. The
redefinition error is coming from the eval() code. So I commented it out so it
is:

if ( !function_exists('apache_request_headers') ) {
/**
* Compatibility so we can use the apache function name and still work with
CGI
* @package awl
*/
//function apache_request_headers() {
//eval('
function apache_request_headers() {
foreach($_SERVER as $key=>$value) {
if (substr($key,0,5)=="HTTP_") {
$key=str_replace("
","-",ucwords(strtolower(str_replace("_"," ",substr($key,5)))));
$out[$key]=$value;
}
}
return $out;
}
//');
//}
}


Some background. I am an OK-ish PHP coder but I suspect with vastly inferior
experience to you. I haven't used eval() before so I looked it up in the
manual. I am baffled!
No disrespect! :) :) but why would you use the eval() statement the way you
do there? I can't see the benefit, and with my twisted logic, I can't
understand how it can ever work, yet obviously it does elsewhere including my
local machine! But looking at the uncommented code, why wouldn't you always
get a redefinition error since you are immediately redefining a function with
the same name inside a function! Boy I've sure got some learning to do! And
why does it only throw an error on the hosted cPanel solution and nowhere
else? My head is ready to explode!

Cheers! :)



>
> ------------------------------------------------------------------------
> andrew (AT) morphoss (DOT) com +64(272)DEBIAN
> You are a very redundant person, that's what kind of person you are.
> ------------------------------------------------------------------------
>