hassank1 Posted April 3, 2008 Share Posted April 3, 2008 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 https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/ Share on other sites More sharing options...
patrick24601 Posted April 3, 2008 Share Posted April 3, 2008 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 https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508610 Share on other sites More sharing options...
PFMaBiSmAd Posted April 3, 2008 Share Posted April 3, 2008 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 https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508613 Share on other sites More sharing options...
rhodesa Posted April 3, 2008 Share Posted April 3, 2008 http://us2.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc Link to comment https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508615 Share on other sites More sharing options...
hassank1 Posted April 3, 2008 Author Share Posted April 3, 2008 thx for the replies.. magic quotes ? while reading articles I thought it's good to prevent injections ( anyway am using real_escape...) ok .. am I able to turn magic quotes off (btw am using shared hosting),if yes how ? Link to comment https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508626 Share on other sites More sharing options...
rhodesa Posted April 3, 2008 Share Posted April 3, 2008 magic quotes is being removed in PHP6. mysql_real_escape_string is the better way Try creating a file in the main directory called .htaccess and in it put: php_value magic_quotes_gpc 0 Link to comment https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508636 Share on other sites More sharing options...
rhodesa Posted April 3, 2008 Share Posted April 3, 2008 And you can test it with this simple script: <?php print "Magic quotes is ".(get_magic_quotes_gpc()?'ON':'OFF'); ?> Link to comment https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508638 Share on other sites More sharing options...
hassank1 Posted April 3, 2008 Author Share Posted April 3, 2008 ok I'll test it .. btw "htaccess" already exists !! what's its job? Link to comment https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508691 Share on other sites More sharing options...
rhodesa Posted April 3, 2008 Share Posted April 3, 2008 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 https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508696 Share on other sites More sharing options...
hassank1 Posted April 3, 2008 Author Share Posted April 3, 2008 after editing the file ! I can't open any page error : Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Link to comment https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508707 Share on other sites More sharing options...
rhodesa Posted April 3, 2008 Share Posted April 3, 2008 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 https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508741 Share on other sites More sharing options...
discomatt Posted April 3, 2008 Share Posted April 3, 2008 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 https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508763 Share on other sites More sharing options...
PFMaBiSmAd Posted April 3, 2008 Share Posted April 3, 2008 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 https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-508788 Share on other sites More sharing options...
rhodesa Posted April 4, 2008 Share Posted April 4, 2008 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 https://forums.phpfreaks.com/topic/99396-some-issues-appears-when-moving-wamp-linux-hosting/#findComment-509147 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.