"You must activate SQL Rewriting to use this script" BUT

Discussions and support about the different URL Rewriting techniques for phpBB.

Moderator: Moderators

"You must activate SQL Rewriting to use this script" BUT

Postby raster » Sat Jul 02, 2011 2:43 pm

So I have followed the required processes and when in Mixed mode I try and enable URL re-writing and run the phpbb_seo/sync_url.php scirpt I get the above error.

Currently all forums are working and displayed in pre-mod style. Manually entered URLs in the URL re-written style do work.

So I thought maybe I had skipped the 777 cache directory & files until after installing the script. So I uninstalled, re-installed phpbb_seo/phpbb_seo_install.php and tried enabled URL re-writing still no joy. Yes, the cache in the forum directory is cleaned all the time.
raster
 
Posts: 6
Joined: Sat Jul 02, 2011 2:36 pm

Advertisement

Re: "You must activate SQL Rewriting to use this script" BUT

Postby RobertKS » Tue Dec 27, 2011 4:10 pm

Having the same problem (only I'm using advanced mode). I followed the install instructions exactly. Did you find a solution, raster?
RobertKS
 
Posts: 26
Joined: Tue Dec 27, 2011 10:31 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby Stephen26 » Tue Dec 27, 2011 6:43 pm

Are the /phpbb_seo/cache/ directory + phpbb_cache.php writeable? Does downloading the phpbb_seo/cache/phpbb_cache.php file and changing 'url_rewrite' => false to 'url_rewrite' => true and reuploading work?
I install and configure phpBB-SEO (and other mods) for a fair price and very fast. If you are interested simply send me a private message.
Stephen26
phpBB SEO Team
phpBB SEO Team
 
Posts: 427
Joined: Mon May 03, 2010 7:06 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby RobertKS » Tue Dec 27, 2011 9:48 pm

Stephen26 wrote:Are the /phpbb_seo/cache/ directory + phpbb_cache.php writeable?


The cache directory stays writable but for some reason the phpbb_cache.php file has become unwriteable twice after I chmodded it. In any case, it does have url_rewrite set to true (didn't require manual modification and re-uploading).

And yes, I am constantly purging the cache, both by going to /cache/ and deleting all the files except .htaccess and by clicking "run now" on "Purge the cache" under the General tab in the ACP.
RobertKS
 
Posts: 26
Joined: Tue Dec 27, 2011 10:31 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby RobertKS » Tue Dec 27, 2011 9:56 pm

I'm not sure what triggers it, but somehow the phpbb_cache.php file changes the permissions on itself to rw------- (600). Even so, the file continues to state that 'url_rewrite' => true and 'sql_rewrite' => true.
RobertKS
 
Posts: 26
Joined: Tue Dec 27, 2011 10:31 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby coyote » Wed Dec 28, 2011 5:39 am

I think the files changing permissions in the cache folder by themselves is normal, because the script is setting them that way no matter what the containing folder is set at (I think). Your cache should clear itself just fine.

As for the error, there's no reason to run sync_url.php if you don't use sql rewriting, which only affects topic url's, not the rewritten forum names. The error is intentional:

Code: Select all
if (empty($phpbb_seo->seo_opt['sql_rewrite'])) {

    
trigger_error($user->lang['SYNC_REQ_SQL_REW'], E_USER_WARNING);

}
 


Which means if sql rewriting is set to No in the ACP, trigger the error.

If you activate SQL rewriting in the ACP, this is the message you'll get after you click Submit. The link called this page in the screenshot goes to sync_url.php:

Image
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 284
Joined: Fri May 11, 2007 6:24 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby RobertKS » Wed Dec 28, 2011 3:07 pm

coyote wrote:Which means if sql rewriting is set to No in the ACP, trigger the error.


I have SQL rewriting set to Yes in the ACP and I still get the error.
RobertKS
 
Posts: 26
Joined: Tue Dec 27, 2011 10:31 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby Stephen26 » Wed Dec 28, 2011 3:46 pm

You could probably comment out those lines in the sync_url.php, altough I don't think it's the best solution, but whatever works.

Code: Select all
// if (empty($phpbb_seo->seo_opt['sql_rewrite'])) {
//   trigger_error($user->lang['SYNC_REQ_SQL_REW'], E_USER_WARNING);
// }
I install and configure phpBB-SEO (and other mods) for a fair price and very fast. If you are interested simply send me a private message.
Stephen26
phpBB SEO Team
phpBB SEO Team
 
Posts: 427
Joined: Mon May 03, 2010 7:06 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby RobertKS » Wed Dec 28, 2011 5:42 pm

OK, I commented out the error check, and when I ran the script again, this is what I got:

Attention, do not stop the script until it ends, and back up your db before you use it!
Start topic URLs synchronization
Reset all topic URLs

I clicked on the first link to start, and that brought me to this error:

Fatal error: Call to a member function set_url() on a non-object in [my webroot]/phpbb_seo/sync_url.php on line 78

Line 78 is the last line of this while loop:

Code: Select all
while ($row = $db->sql_fetchrow($result)) {
      $forum_data[$row['forum_id']] = $row['forum_name'];
      $phpbb_seo->set_url($row['forum_name'], $row['forum_id'], $phpbb_seo->seo_static['forum']);
   }
RobertKS
 
Posts: 26
Joined: Tue Dec 27, 2011 10:31 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby Stephen26 » Wed Dec 28, 2011 6:03 pm

Before making the suggestion to comment out these lines in sync_url.php I tried that on my test board first and the synchronization process finished without errors. Hopefully dcz, SeO or coyote have an idea that helps you...
I install and configure phpBB-SEO (and other mods) for a fair price and very fast. If you are interested simply send me a private message.
Stephen26
phpBB SEO Team
phpBB SEO Team
 
Posts: 427
Joined: Mon May 03, 2010 7:06 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby coyote » Wed Dec 28, 2011 6:25 pm

RobertKS wrote:I have SQL rewriting set to Yes in the ACP and I still get the error.


Aha, I missed that little tidbit. Makes sense, though. Sorry, it was late last night and I wasn't thinking. Let me investigate further.
Last edited by coyote on Wed Dec 28, 2011 6:31 pm, edited 1 time in total.
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 284
Joined: Fri May 11, 2007 6:24 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby Stephen26 » Wed Dec 28, 2011 6:27 pm

When I tried to open http://yourdomain.tld/phpbb_seo/cache/phpbb_cache.php / .current / .old in my browser I expected to get a 403 forbidden error or something, but it's a 500 +" Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

Are really all the relevant files in the /phpbb_seo/cache/ directory?
Last edited by Stephen26 on Wed Dec 28, 2011 6:28 pm, edited 1 time in total.
I install and configure phpBB-SEO (and other mods) for a fair price and very fast. If you are interested simply send me a private message.
Stephen26
phpBB SEO Team
phpBB SEO Team
 
Posts: 427
Joined: Mon May 03, 2010 7:06 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby RobertKS » Wed Dec 28, 2011 6:27 pm

Obviously the object $phpbb_seo isn't being instantiated. Either something's not being "include"d properly or some part of the install went wrong or... who knows? The install seemed to run pretty smooth. Can I run the install script again without adverse consequences? Or will that not help?
RobertKS
 
Posts: 26
Joined: Tue Dec 27, 2011 10:31 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby RobertKS » Wed Dec 28, 2011 6:32 pm

Stephen, I get the same error (505 + 404) when I try to access that file via a browser (whether I am logged in or not).

To confirm, there are three files in my [webroot]/phpbb_seo/cache/ folder, phpbb_cache.php, phpbb_cache.php.current, and phpbb_cache.php.old.
RobertKS
 
Posts: 26
Joined: Tue Dec 27, 2011 10:31 am

Re: "You must activate SQL Rewriting to use this script" BUT

Postby coyote » Wed Dec 28, 2011 6:43 pm

Stephen26 wrote:" Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."


That just means you don't have a specific ErrorDocument "500 Internal Server Error" page to display, and doesn't mean phpbb_cache.php is not there or unreadable. You're getting a 500 error because it's not meant to be called in a browser, it's just an informational array that phpbb_seo uses to store its settings.

You should also have .htaccess and .htaccess.current in that same directory. Can you post the contents of phpbb_cache.php.current and phpbb_cache.php.old for me? I don't think there's anything sensitive in there.

From this error you posted, Fatal error: Call to a member function set_url() on a non-object in [my webroot]/phpbb_seo/sync_url.php on line 78, it sounds like one of your forum or topic id's is missing, or it doesn't like what you named one of the topics, but that's a guess. I'm still learning PHP.
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 284
Joined: Fri May 11, 2007 6:24 am

Next

Return to phpBB mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 15 guests