Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(): Failed opening '/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php' for inclusion (include_path='.:/opt/cpanel/ea-php70/root/usr/share/pear') in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24
php.ini – unethost無限空間虛擬主機 技術分享部落格

如何解決 php 出現 Warning: session_start() 的錯誤訊息?

php_issue_wp
使用php這類opensource的程式語言,所撰寫的應用程式,當在瀏覽器上執行程式時出現錯誤,通常都會有 error message 可以查看,相當方便於除錯及調整。
我們這次介紹的是,如果跳出Warning: session_start() 開頭的字眼,其實可能影響到的是有三個參數;需要仔細看完完整敘述後,才能真正解掉這個問題。
以下我們介紹的是在程式本身bugs,而改由調整主機的方式。

閱讀全文 如何解決 php 出現 Warning: session_start() 的錯誤訊息?

如何解決網站出現 allowed memory size of …..的錯誤狀況

memory_wp

安裝的套裝程式,比方說 wordpress ,drupal , joomla ……等等,
偶爾都會出現 allowed memory size of …… 這個錯誤訊息;查看網路上的教學,
不外是得要修改程式去增加 memory limit 的上限,但經我們實測,只修改程式,
不見得能解決這個問題,得要透過直接修改 php.ini 。

閱讀全文 如何解決網站出現 allowed memory size of …..的錯誤狀況

Fastcgi and Custom php.ini

如果主機的php是用fastcgi的方式來配置時,會發生一個現象,無法用.htaccess來修改php.ini裡的參數。這時候,就必須做一些特定的修改,才能辦到。

何時會需要修改php.ini的參數呢?一個很常見的例子,就是register_globals 。在php 4之前,這個常常是On的。但是為了安全性,php 5開始,及很多新的php套裝程式,都必須是Off才能安裝。

1) 將客製化的php.ini ( custom php.ini )移到 public_html/cgi-bin/這個資料夾下

2) 在 cgi-bin 這個資料下, 生成 php.fcgi 這個檔案,並寫入下方的內容
#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5

3) chmod +x php.fcgi

4) 上傳 .htaccess 到 public_html資料夾,並加入下方的內容
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.fcgi

5) 在php.conf中,加入path
在 /usr/local/apache/conf/php.conf 這個檔案中,加入下方的內容
Action php5-fastcgi /cgi-bin/php.fcgi
AddType application/x-httpd-php .php

6)萃取apache的conf檔,並且重新啟動之
/usr/local/cpanel/bin/apache_conf_distiller –update
/scripts/rebuildhttpdconf
/etc/init.d/httpd restart

後記:
經過我們實際上的實驗,(4)這個步驟修改.htaccess檔在某些情況下,必須省略。例如,要修改的網站,本身的空間裡有附加(attach) 子網域(subdomain) 的時候。