mattinsa

Topic: Installation issue - line 137

Hey there,

I have tried to help myself and look at other issues etc like mine but still have not come right.

A few facts:

My webhost: www.asmallorange.com

Apache version    1.3.41 (Unix)
PHP version    5.2.8
MySQL version    4.1.22-standard

My Jobberbase dev site is at: http://www.graylink.za.net/jobs

I am getting the error: Parse error: syntax error, unexpected '{' in /home/graylink/public_html/graylink.za.net/jobs/config.php on line 137

I am getting an error and have used the code as it is from the zip off jobberbase.com

I have PHP 5 enabled, and my host does support the mysqli PHP extension

On line 137 I have the standard jobberbase code:

try
    {
        $db = new Db(DB_HOST, DB_USER, DB_PASS, DB_NAME);
        $db->Execute('SET CHARSET UTF8');
    }
    catch(ConnectException $exception) 

I have tried the mods included in the readme, as well as mods on the htacess...

I have not modified anything but the connections to the databse and imported the SQL file which I should have…

I have the standard out of the box code running and am getting this issue, so I am thinking it must be something with regards to my shared hosting environment, I could be wrong.

Thanks for the help

Matt

Last edited by mattinsa (2009-02-20 16:34:14)

putypuruty

Re: Installation issue - line 137

Hi,

Your problem is caused by the fact that php5 is not active. I've looked around on your hosting's support pages and found that in order to enable you have to add the following line

Code:
AddType application/x-httpd-php5 .php

to your .htaccess file. Taken from here http://wiki.asmallorange.com/HOWTOPhpFastCGI

mattinsa

Re: Installation issue - line 137

I really appreciate your time in helping me on this - much appreciated.

I changed my .htaccess file to this

# AddType x-mapp-php5 .php
# AddHandler x-mapp-php5 .php
AddType application/x-httpd-php5 .php

RewriteEngine on
Options +FollowSymlinks

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

ErrorDocument 404 /page-unavailable/

<files ~ "\.tpl$">
order deny,allow
allow from none
deny from all
</files>

but now I just get an error with the following:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@graylink.graylink.biz and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Apache/1.3.41 Server at www.graylink.za.net Port 80

Did I add the code correctly, maybe not?

THanks for your help, getting closer!

putypuruty

Re: Installation issue - line 137

Hi.

The problem is caused because the .htaccess file is incompatible with apache 1.3 (it works with apache 2.X). Use this alternative (it should work):

Code:
AddType application/x-httpd-php5 .php

RewriteEngine on
Options +FollowSymlinks

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ index.php?page=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/$ index.php?page=$1&id=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ index.php?page=$1&id=$2&extra=$3 [L]

ErrorDocument 404 /page-unavailable/

Also, use the following as the content of the .htaccess file from the admin folder:

Code:
AddType application/x-httpd-php5 .php

RewriteEngine on
Options +FollowSymlinks

RewriteBase /admin

#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . index.php [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ index.php?page=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/$ index.php?page=$1&id=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ index.php?page=$1&id=$2&extra=$3 [L]

ErrorDocument 404 /page-unavailable/

Let us know if it worked!

mattinsa

Re: Installation issue - line 137

Yes!

It worked, I really appreciate your assistance again - this has been an exceptional experience from a community support basis.

I have big plans with jobberbase, and so I am glad to be on track!

Thanks again and have a great weekend!

Matt

mattinsa

Re: Installation issue - line 137

OK-just when I thought all was working - when I try login to admin or when I click "Post a job" I get the following error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@graylink.graylink.biz and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Apache/1.3.41 Server at graylink.za.net Port 80

at least the site is now showing, but it seems that further changes need to be made...

would this mean more changes to the .htaccess file?

thanks in advance!

Matt

putypuruty

Re: Installation issue - line 137

Hmm.

First try to replace RewriteBase / with RewriteBase /jobs

If this doesn't work, try commenting out the line that contains RewriteBase (put a # char in front of the line).

mattinsa

Re: Installation issue - line 137

thank you once again, adding

RewriteBase /jobs to the .htaccess files

and adding RewriteBase /jobs/admin to the .htaccess file in the admin file seemed to have got everything working...

Getting there - lastly it seems that pages from the nav in admin are not found:

when i click these pages in admin: Pages/Categories/Stats I get the following error pages

Not Found
The requested URL /jobs/admin/categories was not found on this server.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.41 Server at graylink.za.net Port 80

Is there something I need to do to enable these links?

Almost there!

putypuruty

Re: Installation issue - line 137

This is a (stupid) bug (but has already been fixed for the next version wink)

Open /admin/_templates/header.tpl and put a / character at the end of the links (like I have it below):

Code:

<li {if $current_category == 'pages'}class="selected"{/if}><a href="{$BASE_URL_ADMIN}pages/">Pages</a></li>
<li {if $current_category == 'categories'}class="selected"{/if}><a href="{$BASE_URL_ADMIN}categories/">Categories</a></li>
<li {if $current_category == 'stats'}class="selected"{/if}><a href="{$BASE_URL_ADMIN}stats/">Stats</a></li>
<li {if $current_category == 'password'}class="selected"{/if}><a href="{$BASE_URL_ADMIN}password/">Change your password</a></li>

mattinsa

Re: Installation issue - line 137

excellent - all working, and file amends zipped for multiple installations with no more tweaks needed in future.

hopefully I will be able to get on my way now, thanks for your assistance - much appreciated again!

Tokyoj

Re: Installation issue - line 137

Glad you're up and running.
Let us know the URL(s) and it'll be added to the "Show Off" list.

---------------
Tokyoj
"You can't build a reputation on what you're going to do." (Henry Ford)
"Insanity is doing the same thing over and over, expecting different results." (Albert Einstein)

parusa619

Re: Installation issue - line 137

Good morning guys! I have my site updated, but I am getting issues in the admin area wherein I am 404 redirected whenever I click the categories link

putypuruty

Re: Installation issue - line 137

Please apply the patch that I've provided above:

http://www.jobberbase.com/forum/post4260.html#p4260

adslgeek

Re: Installation issue - line 137

Hi there,

I have the exact same issues, I am hosted on GoDaddy, (I believe it is version 1.3 Apache with Modrewrite on) and I have stepped through each of these instructions and I am still getting errors.

I have applied each of the .htaccess instructions above as well as the patch / edits to the URL,

I have added the subdirectory redirect eg
> First try to replace RewriteBase / with RewriteBase /jobs

And also tried commenting it out.
> If this doesn't work, try commenting out the line that contains RewriteBase (put
> a # char in front of the line).

but I am now getting the following error.

Parse error: parse error, unexpected '{' in /home/content/adslgeek/jobs/config.php on line 137

I have been either getting the 137 error or 404 errors when I am clicking on either the admin or any other directories.

Any help would be appreciated..

Cheers,
ADSL geek.

links

Re: Installation issue - line 137

Hi,

If it gives you the 137 error, you have to do this:
http://www.jobberbase.com/forum/post4232.html#p4232

adslgeek

Re: Installation issue - line 137

Hi there,

I have worked through all these items.
1) I have applied the patch on
http://www.jobberbase.com/forum/post4260.html#p4260

2) I have tried every single items from here:
http://www.jobberbase.com/forum/new-reply1156.html
http://www.jobberbase.com/forum/post4232.html#p4232

But still getting 137 error. Any help would be appreciated!

Cheers,
ADSL Geek.

adslgeek

Re: Installation issue - line 137

Thanks for that, I have carefully ran through all that advice, but still getting the 137 error. sad

links

Re: Installation issue - line 137

Hi,

Are you sure you have php 5 on your server? You'll find the steps necessary to verify this in the beginning of the installation guide:

http://www.jobberbase.com/wiki/index.ph … tion_Guide

adslgeek

Re: Installation issue - line 137

Ah! got it in the end:

For Godaddy, on Linux hosting they have used php 4 and you need to specify php5 for it to work. Just add this to the .htaccess and that made it work for me.

AddHandler x-httpd-php5 .php
AddHandler x-httpd-php .php4

olobank

Re: Installation issue - line 137

i have the same problem please. when i go to my domain at www.jobberguy.com i get something, but at www.jobberguy.com/admin, i get page not available. please help

olobank

Re: Installation issue - line 137

i have the same problem please. when i go to my domain at www.jobberguy.com i get something, but at www.jobberguy.com/admin, i get page not available. please help

vistor92

Re: Installation issue - line 137

Hi all,

I have the same problem but when I change the .htacces for:
AddType application/x-httpd-php5 .php

RewriteEngine on
Options +FollowSymlinks

RewriteBase /admin

#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . index.php [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ index.php?page=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/$ index.php?page=$1&id=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ index.php?page=$1&id=$2&extra=$3 [L]

ErrorDocument 404 /page-unavailable/

The web continues in blank... What can I do?

Thank you.

vistor92

Re: Installation issue - line 137

And in the /admin i can see those errors:
Warning: mysqli::mysqli() expects parameter 5 to be long, string given in /home/buscosup/public_html/_includes/class.Db.php on line 20

Warning: mysqli::query() [mysqli.query]: Couldn't fetch Db in /home/buscosup/public_html/_includes/class.Db.php on line 72

Warning: mysqli_error() [function.mysqli-error]: Couldn't fetch Db in /home/buscosup/public_html/_includes/class.Db.php on line 73

Warning: mysqli::query() [mysqli.query]: Couldn't fetch Db in /home/buscosup/public_html/_includes/class.Db.php on line 31

Warning: mysqli_error() [function.mysqli-error]: Couldn't fetch Db in /home/buscosup/public_html/_includes/class.Db.php on line 32

Fatal error: Call to a member function fetch_assoc() on a non-object in /home/buscosup/public_html/_includes/class.JobberSettings.php on line 23

Fartherfoss

Re: Installation issue - line 137

I solved the issue. I made the "'ini_display_errors' => 'on'," and found that the issue was due to DB USER.