Beerwin's World of Stuff

things for, on and about web

Newsflash

Due to lack of interest in my destop projects (PlainHTML, ShutDownerXP, and newly, WE editor), i decided to shut down all activity regarding desktop projects, this time for good.

In the meantime, i've found my code editor of choice, in the great Eclipse editor, so this is another reason not to develop "yet another web editor". Many third-party components used in my projects are too much buggy, to continue development, some of them outdated, and i don't have time to fix them all. It's a waste of my time, and it will lead to nothing. I'm committing my time to PHP development from this time forward.

The BWS project will be cut down to a minimum, and the forum section will be shut down. I will archive the site, and remove pretty much everything not related to PHP development and web design.

I am introducing a new feature: Logging in with GMail account credentials.

I believe, this will be a good idea, since it won't require to register on the BWS site.

I began to upload some new kind of stuff, widening the content scope of this site. When new information is too valuable to be collected by different content bots, i will put them behind authentication.

User accounts created for the forum are member accounts, thus enabling for you to see these internal articles.

Sign Up here for free!

There is a new template available on BWS: Silver Plating

This is a new template for larger sites, portals, community sites, galleries, etc.

 

 

I want to see it

Old web templates were dropped, because they are out-of-date did not comply with today's standards, and many more reasons.

Those templates will not be available anymore.

Community

HomeResourcesWeb DesignPrestashop magic_quotes_runtime fix

Prestashop magic_quotes_runtime fix

This one requires some PHP knowledge.

Today i installed Prestashop and i’ve got a lot of trouble with lots of backslashes in an otherwise valid SQL query. Somehow i’ve managed to get thru it by altering the installation code and removing the addslashes functions. I know it’s not the best way, but it worked for me.

It’s okay to do this with the installation script, but Prestashop has many files, including smarty templates which may be a tremendous task to modify, and it’s not recommended.

I recommend to insert the code shown below into the index.php file found in your install folder too.

So, i checked something on my server, namlely the magic_quotes_runtime directive in PHP.ini. It was enabled (set to ‘on’). As i can see, both Prestashop and Smarty are having problems with this setting. What i did, was to change this setting to ‘off’ and restart my apache server.

What if you don’t have access to the php.ini file? (Shared hosting, permissions, etc). Open the main index.php file in your Prestashop folder, and insert into the second line:

{CODE brush:php}
ini_set('magic_quotes_runtime','0');
{/CODE}

Save the file.

This one solves the problem with blank Front page and backslashes in different texts.

Open the php.ini file in your prestashop admin folder (That one you renamed after installation) and insert after the comments, before the line define(‘PS_ADMIN_DIR’, getcwd()); the following:

{CODE brush:php}ini_set('magic_quotes_runtime','0');{/CODE}

Save the file.

This one solves the problem with payment module parse errors in the Back office page.

This trick worked for me.

Warning! If you are using a free shared hosting service, there is a high chance, that php runs in safe mode, or some functions are disabled. The ini_set function is often disabled on such kind of hosting services. In this latter case, you have to find another hosting provider.


Discuss this article
You need to log in or register to participate in this discussion.

Latest news

From the blog