I have installed WordPress locally on WampServer for testing purposes. I discovered that when I changed the permalinks structure to reflect post title (the title is in my native language 'Urdu'), and requested the following page in browser
http://localhost/blog/طوفان-اور-سیاست-دان/
it returned a 404 error which said
The requested URL /blog/طوÙان-اور-سیاست-دان/ was not found on this server.
I am using WampServer 2.2 and WordPress 3.4.
Since many PCs don't have an Urdu font installed, here is the image of first address for you.
The English translation for urdu part is "Storm-and-politicians" . Urdu, unlike English, is written from right to left.
How can I configure my local web server to accept web adresses in Urdu? Many sites including the Urdu wikipedia use this scheme.
How to learn more about this problem:
Each time you see apache giving you a not-found message, you will find an according entry in the error log of your webserver. It contains more information what happens behind the scenes.
For example you will see a message similar to this one:
File does not exist: C:/.../htdocs/blog/\xd8\xb7\xd9\x88\xd9\x81\xd8\xa7\xd9\x86-\xd8\xa7\xd9\x88\xd8\xb1-\xd8\xb3\xdb\x8c\xd8\xa7\xd8\xb3\xd8\xaa-\xd8\xaf\xd8\xa7\xd9\x86
This is useful because it allows you to see the binary sequence the apache webserver uses to query your file-system for the file.
You can turn this into a PHP string to decipher it:
echo "\xd8\xb7\xd9\x88\xd9\x81\xd8\xa7\xd9\x86-\xd8\xa7\xd9\x88\xd8\xb1-\xd8\xb3\xdb\x8c\xd8\xa7\xd8\xb3\xd8\xaa-\xd8\xaf\xd8\xa7\xd9\x86";
Depending in which encoding you view this output, it can look like the following:
UTF-8 : طوفان-اور-سیاست-دان
Ansi : ÏÀ┘ê┘üϺ┘å-Ϻ┘êÏ▒-Ï│█îϺÏ│Ϭ-ϻϺ┘å
ISO-8859-1: طوÙان-اور-سیاست-دان
Apart from having this looking differently, the question is why does the webserver not find this file?
As you write you use wordpress, you probably just have missed to enable these type of URLs, in Wordpress jargon those are called "Pretty" permalinksCodex.
Related
I am in the process of migrating an existing Drupal website from another provider to Bluehost.com -- while I think using Bluehost.com is not relevant in this context I thought I'd mention it anyway, in case there are indeed some particularities I'm not aware of.
The site is a Drupal 6 installation and it did work previously I am told on bluehost too so you think it shouldn't be any problems, however, having copied it over I encounter a big problem: all the responses from Drupal are sent with Content-Encoding set to application/x-gzip. This has the implication of all browser presenting a download dialog box rather than rendering the content.
I have actually curl'd the index page and ran it through gunzip and the output is the correct HTML for the site -- just that it somehow ends up being gzip'd and this mangles the content type and confuses the browsers.
Talking to previous maintainers of the site they suggested using PHP 5.4 (they were running it on php 5.5 as I understand and despite all the Drupal suggestions it was running perfectly well I'm told).
I am trying to eliminate now any type of gzip'ing that occurs here so I've got it down to a few layers which could cause it but eliminating those it still doesn't work:
SetEnv no-gzip 1 in .htaccess
zlib.output_compression = Off in php.ini
drupal had the boost module installed and some corresponding settings in .htaccess -- i've removed those from the .htaccess file as well as deleting the boost directory from sites/all/modules
The problem still stands and my files are being sent to the browser compressed. Is there any other way to disable this?
Note that this only happens for pages inside Drupal, having uploaded a simple php page and navigate to that url works fine -- which suggests therefore a drupal (rather than apache/php) problem.
I've noticed a module mimedetect which has a definition for application/x-gzip in there but not sure how could this affect it as removing this didn't render anything useful either.
Any ideas where to look and/or what might cause it?
Happy to provide any other insights that might be useful in diagnosing this.
Ok so having actually reset the database cache and with the settings above this now works. I'm trying to figure out which one of the above actually solved it.
m having a strange problem never faced it before and tried every thing and i mean everything but no luck at all.
What happened was i downloaded the application source code built on joomla 1.7 via ftp from the live server and deployed it on my localhost and configured it correctly. Now what happened is it displaying some sort of raw data all over the browser window, attached is the screenshot.
Please guys its been 5 days since i stuck in this mess any help will be highly appreciated
Thanks in advance
Maybe you have installed an extension, which supports distribution of PHP code as binary code? There exist different extensions to PHP, which support this kind of functionality. Probably the most widespread is Zend Guard. To execute a script which was encrypted by this software your PHP needs to load the free loader extension provided by Zend. If your server has loaded this extension and your localhost does not, the output might be something like you encounter.
Your first step should be to compare the output of phpinfo of both servers. If Zend Guard (or a similar extension) is loaded on your production server and not on your localhost, this might be the problem. Next step should involve taking a look at the PHP files and search for one which contains lots of unreadable characters. If this seems unreasonable to you, you might as well just install Zend Loader and see if it works then, which might be less work.
I am replacing an existing very old site written in another lang with a newly-coded php site and I need to double-check a couple of things with respect to security. Website will be running on Windows 2008 R2 using IIS 7.5 and running php 5.3.8.
I am storing db login creds in a file outside of web root. But in my php code I have to include those files and I am using an absolute path. Will php and/or IIS strip out the file path. (I imagine the answer is yes since competing technologies would do likewise, but need to be sure on this and couldn't find the answer.)
On a related point, what is the best place to keep .js files? Is it better security-wise to keep them outside of web root?
Sorry for the basic questions, but am new to php (long time programmer in other langs).
well, php is different from ASP, so my suggestion is to make a subdomain for js/css, you even can name it CDN... but, it still better than from the root.
I ran a bunch of tests where I looked at the source of what is returned by php and the webserver. If you use the php command "require c:\abc\file.php" neither piece of information is returned with the html.
However, the path to a .js file IS displayed. This is because it sits inside the html, not php, so that path is NOT stripped out by php or the webserver.
So from this I think I can safely say:
1. The path to the creds will not be displayed in the html source returned to the browser or curl call or whatever.
2. js and css paths are shown publicly so it is worth considering whether these need to be secured (e.g., separate subdomain or similar).
I have couple of websites on php. I want to mobile enable them so they can be seen from a smart phone or iphone. Is there any quick conversion tools for these.
I tried the steps in this site and got a 500 exception from hostgator.
http://www.mikeindustries.com/blog/archive/2005/07/make-your-site-mobile-friendly
I am looking for some rad techniques. my sites are not complex.
for eg. yndc.tradepeacefully.com
From hostgator support :
http://support.hostgator.com/articles/hosting-guide/hardware-software/is-php-running-as-apache-or-cgi
Now check the notes on the link you posted, especially note 3 :
In order to use auto prepending and
auto appending, you must be running
PHP as a standard Apache module and
not “as cgi”. If need be, you can run
PHP as Apache sometimes and CGI other
times by using your .htaccess file to
specify rules.
So this approach won't work on Hostgator (unless you're on dedicated hosting, see the support page), since they're running PHP as CGI...
To mobile-enable your site, you just need two things:
Detect the browser's user agent.
Forward to a mobile version of the site.
You should be able to find a htaccess file on Google that will accomplish the #1. The hard part is going to be coming up with a new layout for your site that is mobile-friendly.
That part will be mostly written from scratch.
You get the 500 error probably because your hosting provider does not support the php_value in .htaccess files.
I would like to be able to port some new site pages over to PHP using the same db as in the coldfusion site. Is it possible to have PHP run pages in say other directory and go back and forth ?
Many thanks for your reply.
Terry
As others have said, yes, it is possible. Your configuration doesn't really matter, (unless you're looking for help getting it setup), because it can be done on any modern webserver (Apache, IIS, etc).
Something to think about, though, is the default document. If your web application uses urls like:
http://example.com/myApp/ (no index.cfm or index.php in the url)
Then you need to be aware of the explicit order of default documents. If you have both an index.php and an index.cfm template in the same directory, which will execute?
If your default document list is (a variation of):
index.cfm index.php default.aspx index.html
Then the ColdFusion page will be the one to execute. On the other hand, if the default document list is (a variation of):
index.php index.cfm default.aspx index.html
Then the PHP page will be the one to execute.
Yes, this is possible, I have this available on my production web server (RedHat but it shouldn't matter). If you're looking for details on configuration I couldn't help you though, I had my host set it up. I wouldn't imagine a standard install of both would conflict, just set up the proper handling for each file extension and you should be good to go, keeping them in separate directories or mixing them in one.
It is possible as long as you are running the same web server (i.e. IIS or Apache) for both ColdFusion and PHP. If you let us know what your environment is, people may be able to further assist you - but the answer to your question is yes.
Yes,
It's technically no different to Windows servers which have both PHP and .Net installed, or a Linux server with Perl and PHP.
Speaking generally, after installing the languages you're using you set up your web server to handle files of different extensions. This is done differently depending on whether you're using IIS or Apache, but you effectively say .php files should be handled by the PHP interpreter and .cfm files handled by the Coldfusion interpreter.
As others have said, its entirely possible and not hard to setup. Just watch out for Default Document as Adam Tuttle said.
I will take it a step further: you even run CF and PHP in the same application server!
Use Cauchos Resin for CF and its Quercus support for PHP:
http://quercus.caucho.com/
Of course, if your PHP app is non-trivial and/or relies on some custom extensions or extensions that Quercus doesnt support than your SOL. But might be interesting to check out.