Jump to content

some issues appears when moving [WAMP -> linux hosting]


hassank1

Recommended Posts

when I've tested my site using wamp .. everything worked fine ,however when I've uploaded it to linux some problems appears .. and I'll try to post them here ..

 

1- I've a posting board when some1 post a topic he can edit it .. so let's say the user write the topic :

 

" // " <--- , when he want to edit his topic , the textbox containing the edited topic changed to " ////"

 

however this wasn't the case when testing on wamp !!

Link to comment
Share on other sites

Personally - I gave up on testing anything web related on wampp. I just got tired of the differences. I'll test cmd line stuff. But I just have a test domain in a test account on my linux server. I then autosense what domain I am running off of to determine whether to use 'dev' settings or 'production' settings.

Link to comment
Share on other sites

That is caused by the magic quotes settings (specifically magic_quotes_gpc).

 

If you can, turn all the magic quotes settings off (they have been removed in php6, for the bad idea they were.) If you cannot turn them off, then you must use the stripslashes() function to remove the extra slashes.

Link to comment
Share on other sites

It's used to alter the apache config on a per-directory basis. But it's also recursive, so it applies to the directory it's in and all the directories below it. The php_value command tells apache to tell php to turn off magic_quotes for that directory and below.

Link to comment
Share on other sites

That usually means that your hosting service has disabled that feature then.

 

We could go back and forth all day about this. I would just call your hosting companies support line. They should have an answer for you real quick.

Link to comment
Share on other sites

Personally - I gave up on testing anything web related on wampp. I just got tired of the differences. I'll test cmd line stuff. But I just have a test domain in a test account on my linux server. I then autosense what domain I am running off of to determine whether to use 'dev' settings or 'production' settings.

 

So somehow web servers using different configuration options is WAMP's fault? I actually really like the default settings WAMP is provided with. Perhaps coding with multiple server configurations in mind would be a better approach, or maybe even changing the config in WAMP to match your web servers?

Link to comment
Share on other sites

Php settings in a .htaccess file are only supported when php is running as an Apache server module (and the host has enabled any particular setting to be changeable.)

 

If php is running as a cgi wrapper, then a local php.ini (in the document root folder) is usually supported. Putting php settings in the .htaccess in this case is what triggers the internal server error.

 

----------------

 

Since a local development system is under your control, it is within your ability to configure it to match the setting on a live server to avoid problems when putting code online.

 

However, in this case the live server is using settings that are turned off by default and are being eliminated in the next major release of php, so discovering this difference and hopefully being able to turn the setting off on the live server will give the best long term solution.

Link to comment
Share on other sites

Php settings in a .htaccess file are only supported when php is running as an Apache server module (and the host has enabled any particular setting to be changeable.)

 

If php is running as a cgi wrapper, then a local php.ini (in the document root folder) is usually supported. Putting php settings in the .htaccess in this case is what triggers the internal server error.

 

----------------

 

Since a local development system is under your control, it is within your ability to configure it to match the setting on a live server to avoid problems when putting code online.

 

However, in this case the live server is using settings that are turned off by default and are being eliminated in the next major release of php, so discovering this difference and hopefully being able to turn the setting off on the live server will give the best long term solution.

 

Along those lines, to do it with a php.ini file...in the same directory, try putting a file called php.ini with this line in it:

magic_quotes_gpc = Off

 

A heads up though...in my experience with this method, it only applies to the directory it's in (not sub directories). So essentially you have to put the file in any directory with a PHP script.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.