forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 install => Topic started by: callingrohit on August 14, 2006, 07:45:28 pm

Title: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 14, 2006, 07:45:28 pm
Hi,

I uploaded the contents of cpg148 and chmod album and include folders. Ran the install script...got successful message. Clicked on
login or continue to logon to the system.

I get the following error then,
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /usr/shared/web/george/IMP/cpg148/include/functions.inc.php on line 1790

What should I do now ??? I have no idea....please help...

thanks
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Nibbler on August 14, 2006, 07:51:46 pm
Re-upload the files.
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 15, 2006, 04:15:07 am
Hi nibbler,

do you mean to say I should upload all the files of cpg148...10 MB.....it took a long time....can't i just upload all the include files ????

What does that error actually mean ? because i checked 1790 line under functions.inc.php and i didn't see any syntax error there....

cheers
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Sami on August 15, 2006, 05:41:18 am
first try Re-uploading function.inc.php
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 15, 2006, 05:53:24 am
hi,

i have done that...i have reinstalled the whole package thrice.
Still no luck.....

The software is so kool and yet i'm unable to use it... :( :(

 ???

thanks
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Sami on August 15, 2006, 05:56:58 am
post a link to your gallery
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 15, 2006, 05:59:58 am
http://www.georgesofnorwood.com.au/IMP/cpg148/

Thanks
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Joachim Müller on August 15, 2006, 07:28:00 am
If re-uploading didn't help, then there are two other possible reasons for that error message:
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 15, 2006, 07:34:39 am
Hi,

I use CUTE FTP PRO and the mode is always auto and the ftp client is intelligent enough to upload the files in correct mode. I have been using it since last 3 years and never faced a problem.

But I think on the first point you may be right that maybe the actual file while downloading may be corrupted. I'll download it again and see how it goes....

by the way I would also like to congratulate you guys for making such a wonderful software. Its just awesome.....there are so many possibilities and its totally adaptable...best is the MAC OS X theme...i loved it....which files should i touch if i would like to modify the whole theme and create a customised one.....
i'll do the download and upload tonite....will let you know how it goes....

cheers
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Joachim Müller on August 15, 2006, 07:37:09 am
which files should i touch if i would like to modify the whole theme and create a customised one.....
We have a strict "one question per thread" policy you agreed to respect when signing up. Do so - fix the issue being discussed on this thread. Then read the documentation. If this doesn't solve your additional question, post it in a separate thread.
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 15, 2006, 07:43:00 am
oops sorry guys,

didn't carefully read the fine lines of terms and conditions....was too excited with the software...

anyways thanks...i'll see if i can edit my reply and delete the xtra question....

thanks
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Joachim Müller on August 15, 2006, 07:45:00 am
i'll see if i can edit my reply and delete the xtra question....
Don't! It makes the subsequent answer look silly and msiplaced. Leave your posting as it is, go back to solving your issue by doing as suggested.
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 15, 2006, 07:46:30 am
I I captain..... ;)
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 15, 2006, 07:02:36 pm
Hi,

i deleted all my files from the webhost. Uploaded all of them again and successfully configured it.

Now, this time I didn't get the error i pasted above but got a blank page at the following link
http://www.georgesofnorwood.com.au/IMP/cpg/login.php

Now what do you think might be the problem.

Thanks
Rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Joachim Müller on August 15, 2006, 07:20:07 pm
So you swapped one error with a completely different one. Sigh. You should have done exactly as suggested - instead of deleting everything and starting over, I recommend to do what supporters advice if you actually want support.
Blank pages usually are being caused be white space or blank lines being in a file. Edit login.php with a plain-ext editor. Make sure that it doesn't contain anything (no spaces nor line breaks) after the ending tag
Code: [Select]
?>
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Sami on August 15, 2006, 07:40:54 pm
I've got the old error (function.inc.php line 1790)
May be your host disabled urldecode or getimagesize functions of php ask them for support
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 15, 2006, 07:41:32 pm
hi,

sorry i should have said that after reloading all files once i deleted all the files, i got the blank page. So I thought maybe the include folder got corrupted...so i deleted the include folder and uploaded that folder again. tried the install didn't work.

Third try......i removed everything and uploaded all files again, set permissions correctly on albums and include folder to 777 and installed the software. installed correctly...sql tables formed.....clicked on "Lets continue or login" to logon...blank page...refreshed the page got the same error with which i started this topic
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /usr/shared/web/george/IMP/cpg/include/functions.inc.php on line 1790

The file"login.php" has been checked...it has no spaces or line breaks after the ending tag of php.

thanks
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 15, 2006, 07:44:06 pm
I've got the old error (function.inc.php line 1790)
May be your host disabled urldecode or getimagesize functions of php ask them for support

Is there a way to get around this ??? or do I need to get them to enable it because not sure if they will if they have disabled it ......

thanks
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 15, 2006, 07:55:54 pm
If re-uploading didn't help, then there are two other possible reasons for that error message:
  • the files are already broken on your client (in this case, re-download the coppermine package from a different mirror)
  • There's something fishy with your FTP client. Make sure that you're using a real FTP app (like FileZilla, SmartFTP or WS_FTP), not some crap like MS Frontpage. Make sure that you're usingg the proper FTP mode.

Ans to 1- This has been done. I had downloaded my file from europe...now i did it from australia.
Ans to 2- using CUTE FTP PRO.

thanks
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 18, 2006, 04:44:31 am
Hi.,..I have had no luck...I have uploaded all the files thrice uptill now...making it atleast 10 installations......still no luck.....

urldecode or getimagesize functions are not disabled by our host....

regards
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Joachim Müller on August 18, 2006, 06:51:28 am
Time to find a new webhost then imo.
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 18, 2006, 08:10:33 am
well i would totally disagree with you. I don't see this as a correct approach to solving a technical problem.

Its alright if you say you can't help me solve my problem but don't atleast ask someone else to give up. next thing i know, if mysql doesn't work, you may ask me to again change my webhost.

Sorry gau gau but I totally disagree with this attitude. This may be a bug with the software or may not be a bug. See it from a technical point of view. Isn't open source for that ??? Broaden your views.....well, if anyone else has any technical suggestions as to what I can do to get CPG working on my webhost. I would be very glad.

Gaugau i hope you don't get offended by my above statements. Sorry if you do.

cheers
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Sami on August 18, 2006, 08:55:47 am
okey let's check your host for those php functions ....
please copy the attached file to the root of gallery and execute it
it's safe file it just try to execute urldecode and getimagesize functions
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Joachim Müller on August 18, 2006, 08:59:28 am
You're right - I misread your posting, should have read more carefully. You wrote
urldecode or getimagesize functions are not disabled by our host....
, but I misread it as
Quote
urldecode or getimagesize functions are disabled by our host....
. As a webhost shouldn't disable those innocent functions I suggested finding a new one. Sorry again for misreading and subsequently giving wrong advice, please accept my apologies.
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 18, 2006, 09:04:09 am
Hi,

here's the output :

Executing urldecode Function:
Url of image is: /usr/shared/web/george/IMP/cpg/images/thumbnails.gif
Executing getimagesize Function:
Size Of image is: Array (

I just made a little change in your code, i changed this line from backslash(\) to forward slash(/)
$tumb_path=$abpath.'/images/thumbnails.gif';


cheers
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 18, 2006, 09:06:30 am
hey gau gau,

not a problem...glad we are on the same side .....

 :) ;) ;D

cheers
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Sami on August 18, 2006, 09:29:16 am
Sorry but could you please check this again (I use urlencode to check patern matching or security mod on srver)

Quote
i changed this line from backslash(\) to forward slash(/)
:P windows stuff !
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 18, 2006, 09:48:02 am
here you go,

here is encoded path: %2Fusr%2Fshared%2Fweb%2Fgeorge%2FIMP%2Fcpg%2Fimages%2Fthumbnails.gif
Executing urldecode Function:
Url of image is: /usr/shared/web/george/IMP/cpg/images/thumbnails.gif
Executing getimagesize Function:
Size Of image is: Array (
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Sami on August 18, 2006, 10:10:12 am
here is the code on line 1790 of functions.inc.php
Code: [Select]
$image_info = getimagesize(urldecode($pic_url));
It will be execute within cpg_get_system_thumb() function
when I check login.php I also got the error but there is no calling of cpg_get_system_thumb() function !!!
So it's occure on include statment under init.inc.php !
Sorry I can't help you more
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 18, 2006, 10:26:15 am
i checked init.inc.php there is a statement " require 'include/functions.inc.php'; "....

when the getimagesize and urldecode functions work fine, why is this statement causing line 1790 to come up as a error ????

gaugau whatz your view on this...i noticed you have written the code ....its a nice software i must say......but i can't use it  :'( :'( :'(
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Joachim Müller on August 18, 2006, 07:09:04 pm
I haven't actually written all of it, just some parts. My name just shows through in the header of that file, because I was the last developer editing the file before it got released - that's a feature of the colaboration software we use to maintain the code (Subversion). Often happens that users who are not familiar with such apps mistake the existance of a dev name in the file header for the actual dev who coded it. Usually, this is not the case, as Coppermine is a team effort.

Back to your issue: I'm a bit confused about this thread, I'm not sure what to suggest. To me, it still appears as if some of your files are corrupt. I have no idea what else to suggest except replacing all files with fresh ones, using a fresh copy from a different mirror. You might as well try uploading it using another FTP client from another desktop PC. I'm convinced that you tried all this before, but I can't help it - looks like a file corruption error to me.
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Nibbler on August 18, 2006, 07:41:44 pm
Rename include/functions.inc.php to functions.txt on your server so we can take a look at it.
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 19, 2006, 06:23:00 am
Here you go nibbler

http://www.georgesofnorwood.com.au/IMP/cpg/include/functions.txt

Also, gau gau i'll try to upload the files again with another FTP software.

cheers
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Joachim Müller on August 19, 2006, 06:32:54 am
Not sure where you got your copy from, it differs from the one that was released with cpg1.4.8. Get the most recent file from the stable branch of the svn: http://svn.sourceforge.net/viewvc/coppermine/trunk/stable/include/functions.inc.php
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Sami on August 19, 2006, 06:36:39 am
you have this code from line 1790~1844 ( all these lines are wrong and are not belong here)
Code: [Select]
$ readdir($dir))!==false) {
                        if (is_file($folder . $file) && strpos($file,$thumb_pfx) === 0) {
                                // Store filenames in an array
                                $thumbs[] = array('filename' => $file);
                        }
                }
                closedir($dir);
                return $thumbs;
        } elseif ($folder == $search_folder) {
                // Search folder is the same as coppermine images folder; just return the array
                return $thumbs;
        } else {
                // Search folder is the different; check for files in the given folder
                $results = array();
                foreach ($thumbs as $thumb) {
                        if (is_file($search_folder.$thumb['filename'])) {
                                $results[] = array('filename' => $thumb['filename']);
                        }
                }
                return $results;
        }
}


/**
 * cpg_get_system_thumb()
 *
 * Gets data for system thumbs
 *
 * @param string $filename
 * @param integer $user
 * @return array
 **/

function& cpg_get_system_thumb($filename,$user=10001)
{
        global $CONFIG,$USER_DATA;

        // Correct user_id
        if ($user<10000)
        {
                $user += 10000;
        }

        if ($user==10000) {
                $user = 10001;
        }

        // Get image data for thumb
        $picdata = array('filename'=>$filename,
                         'filepath'=>$CONFIG['userpics'].$user.'/',
                         'url_prefix'=>0);
        $pic_url = get_pic_url($picdata,'thumb',true);
        $picdata['thumb'] = $pic_url;
        $image_info = getimagesize(urldecode($pic_url));
This is not orginal function.inc.php !!! this is totally coruppted ! (may be wrong copy & paste)
Do as gaugau suggested
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 19, 2006, 06:40:49 am
ok, I went to that site, now did you guys want me to just download that functions.inc.php file only or the whole package. if so do you have a zip/ tar file to download because otherwise it will take a long time for me to click on all individual files to download them.

I usually go to CPG's download centre which directs me to sourceforge and from there i select cpg148 stable and select any mirror to download it.....

i hope this works...so that we can close this post.....i'm starting to get sucidal on this.... ;D

cheers
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Sami on August 19, 2006, 06:48:12 am
Do as GauGau Suggested:
Only update your function.inc.php ,
download it from:
http://svn.sourceforge.net/viewvc/coppermine/trunk/stable/include/functions.inc.php
if you have problem let me know I'll attach it to this thread ;)

Update:
Easiest way could be just remove those lines from your functions.inc.php
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Joachim Müller on August 19, 2006, 07:02:54 am
There's something fishy with WebSVN - just use the file I attached to my posting (you'll have to rename it to functions.inc.php).
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 19, 2006, 09:28:36 am
hey guys,

no luck.....i guess cpg just doesn't like me.......hee hee

well i'll download the folder again and upload it tomorrow....do you guys recommend any particular mirror that comes listed under sourceforge.....

do let me know....
cheers
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Joachim Müller on August 19, 2006, 09:38:15 am
What's wrong with the file I attached to my previous posting? Why didn't you use that?
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 19, 2006, 09:40:11 am
ofcourse i used it ...i deleted the old one and uploaded the new one that you attached in your post....deleted install.lock.....and installed it again...all successful, all tables created in mysql....but i get a blank page when I click on login or lets continue......after it shows that the install was successful....
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: callingrohit on August 27, 2006, 04:51:17 pm
Hi guys,

If you want to close this case you can very well go ahead because right now I have no time to debug the webhost and the php pages. But yes there is one bug that I have found in the software...not sure if I shud be calling it a bug or not but anyways...for example if i upload the CPG148 files on to the webserver at a location like this /root/mywebgallery/cpg148

The setup runs fine and successfully creates the tables in the database but you get a blank page on login and also the same errors because of which i opened this post. But if I upload the same set of files to a location like /root/<all cpg148 files>, then everything works fine....without any errors coming up.

thanks
rohit
Title: Re: CPG 1.4.8 - Error after installation is successful
Post by: Joachim Müller on August 27, 2006, 10:20:54 pm
Not a bug imo, but a case of PEBKAC. Glad it has been solved though, marking accordingly.