SearchEngines.bg

Това е примерно съобщение за гост. Регистрирайте безплатен акаунт днес, за да станете потребител на SearchEngines.bg! След като влезете, ще можете да участвате в този сайт, като добавите свои собствени теми и публикации, както и да се свържете с други членове чрез вашата лична входяща кутия! Благодарим ви!

Проблем при mod rewrite при php 5 в wordpress?

Virosss

New member
Здравейте,
появява ми се някакъв странен проблем с mod rewrite когато версията на php ми е 5. При php 4 няма проблем, всичко си върви, но когато я сменя на 5 започват проблемите, някой статии ги отваря, някой не иска. Някой сблъсквал ли се е с този проблем?! Имате ли идея от какво се получава така? Прилагам и .htaccess файла си, ако това ще ви светне по-добре.

Код:
# BEGIN WordPress
AddType application/x-httpd-php5 .php 
php_value upload_max_filesize 100M
php_value max_execution_time 800
php_value post_max_size 100M
php_value max_input_time 100
php_value memory_limit 32
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
 
Re: Проблем при mod rewrite при php 5 в wordpress?

Изкоментирай този ред
AddType application/x-httpd-php5 .php

Servers actually understand three separate MIME types:

application/x-httpd-php
application/x-httpd-php4
application/x-httpd-php5

The MIME types are what actually control which version of PHP is run for a given file type. If the file has MIME type "application/x-httpd-php" (which is the default for ".php" files), our servers will use the version of PHP that you've chosen in your control panel. Files of type "application/x-httpd-php4" (the default for ".php4" files) are always run using PHP 4, and files of type "application/x-httpd-php5" (the default for ".php5" files) are always run using PHP 5.

In other words, when you change a file name suffix from, say, ".php" to ".php5", what that really does is change the MIME type that our servers associate with the file, which in turn changes the version of PHP that the servers use to handle it.

This is useful information because the Apache Web server actually gives you complete control of MIME types. In particular, you can use Apache's AddHandler command in .htaccess files to associate a file suffix with a MIME type for an entire directory. If you force a certain file suffix to use the "application/x-httpd-php4" or "application/x-httpd-php5" MIME types, those files will be run using PHP 4 or PHP 5, regardless of your PHP control panel setting (because the control panel setting only affects files of type "application/x-httpd-php").

For example, if you put this line into a .htaccess file in a directory:

AddHandler application/x-httpd-php5 .php

... then any file in that directory with a name ending in ".php" will be run using PHP 5, even if ".php" files in all your other directories are using PHP 4. You could even do this to make all ".html" files be handled by PHP 5:

AddHandler application/x-httpd-php5 .html

In summary, the MIME type is really what makes our servers choose a particular version of PHP. By default, changing the name to use ".php4" or ".php5" changes the MIME type, which forces a different version to run. But you can have complete control over this process by changing the MIME type for any kind of file yourself with Apache's "AddHandler" command.


И само да добавя че за да го ползваш трябва да имаш зареден модула mime_module или да апаха да е компилиран с този модул
 
Re: Проблем при mod rewrite при php 5 в wordpress?

В момента съм изключил Php5, но някой модули в wordpress-а ми правят проблеми, когато са под Php4, затова и в примера си дадох когато съм включил 5-цата ;) Грешката която ми дава не съм обърнал внимание каква е, но мисля, че е грешка 500..
 
Re: Проблем при mod rewrite при php 5 в wordpress?

Най-добре е да видиш какви са грешките в лога на уеб сървъра. Така най-лесно ще разбереш къде е проблема!
 
Re: Проблем при mod rewrite при php 5 в wordpress?

Servers actually understand three separate MIME types:

application/x-httpd-php
application/x-httpd-php4
application/x-httpd-php5
Напулно точно, само че мястото на тази директива не е в хтаццесс-а, а в хттпд.цонф. Затова предложих да я изкоментира.
 
Re: Проблем при mod rewrite при php 5 в wordpress?

Да, съгласен съм, но след запитване към хостинг компанията( хост.бг ), ми казаха, че така мога да си активирам пхп5... :( Но при всички положения, не това е проблема. Проблема ми е защо този номер ми го прави само под пхп5 ;(
 
Re: Проблем при mod rewrite при php 5 в wordpress?

Virosss ако беше казал какъв е номера все пак който ти прави и какви грешки изкарва, може и някой да ти помогне.
 

Горе