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 !!

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.

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.

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.

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.

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?

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.