ubuntu apache 有下列error
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
1.開啟rewrite module
sudo a2enmod rewrite
2.重開apache
service apache2 restart
2014年7月16日 星期三
2014年7月15日 星期二
Install pcntl extension on ubuntu 14.04
1.抓php source code來編譯pcntl.so
mkdir tmp/phpsource
cd /tmp/phpsource
apt-get source php5
cd /tmp/phpsource/php5-*/ext/pcntl
phpize
./configure
make
2.將編好的pcntl.so複製到php lib裡
cd modules
cp pcntl.so /usr/lib/php5/
3.新增pcntl.ini
vi /etc/php5/mods-available/pcntl.ini
加入下列此行
extension=pcntl.so
4.link to mods-available/
cd /etc/php5/apache2/conf.d
ln -s /etc/php5/mods-available/pcntl.ini 20-pcntl.ini
5.編輯php.ini.
memory_limit = 256M
找到下列這行,並再前方加上;(註解掉此行)
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Install Apache + PHP on Ubuntu 14.04
1.更新apt-get
sudo apt-get update
2.安裝apache
sudo apt-get install apache2 libapache2-mod-auth-mysql
3.安裝php以及所需extension:
sudo apt-get install php5 php5-mysql php5-mcrypt php5-curl
4.重開apache service
sudo service apache2 restart
其他一些常用設定路徑:
1.Configuration File Path
/etc/php5/apache2/php.ini
2.Loaded Configuration File
/etc/apache2/apache2.conf
3.The default Ubuntu document root
/var/www/html
By default, Ubuntu does not allow access through the web browser to any file apart of those located in/var/www, public_html directories (when enabled) and /usr/share (for web applications). If your site is using a web document root located elsewhere (such as in /srv) you may need to whitelist your document root directory in /etc/apache2/apache2.conf.
The default Ubuntu document root is /var/www/html. You can make your own virtual hosts under /var/www. This is different to previous releases which provides better security out of the box.
sudo apt-get update
2.安裝apache
sudo apt-get install apache2 libapache2-mod-auth-mysql
3.安裝php以及所需extension:
sudo apt-get install php5 php5-mysql php5-mcrypt php5-curl
4.重開apache service
sudo service apache2 restart
其他一些常用設定路徑:
1.Configuration File Path
/etc/php5/apache2/php.ini
2.Loaded Configuration File
/etc/apache2/apache2.conf
3.The default Ubuntu document root
/var/www/html
By default, Ubuntu does not allow access through the web browser to any file apart of those located in/var/www, public_html directories (when enabled) and /usr/share (for web applications). If your site is using a web document root located elsewhere (such as in /srv) you may need to whitelist your document root directory in /etc/apache2/apache2.conf.
The default Ubuntu document root is /var/www/html. You can make your own virtual hosts under /var/www. This is different to previous releases which provides better security out of the box.
2012年12月28日 星期五
A tricky and easy Multi-thread method on PHP
分成兩個檔案來達成
parent.php : 在for loop中,利用image tag 產生子thread,以及透過get method傳遞參數。
client.php : child thread
parent.php : 在for loop中,利用image tag 產生子thread,以及透過get method傳遞參數。
client.php : child thread
2012年12月13日 星期四
解决image onload失效的方法
因為想要利用Javascript來調整圖片的大小,所以利用了onload,寫了以下code:
<img src="test.jpg" onload="checkImage" />
在firefox 下完全沒有問題,但在chrome 22 發現image的onload event在很多時候都不會被呼叫。
經過測試後發現改成以下寫法就沒問題了
<img onload="checkImage" src="test.jpg" />
推測是因為cache導致onload event還沒執行到,圖已經載完了。
<img src="test.jpg" onload="checkImage" />
在firefox 下完全沒有問題,但在chrome 22 發現image的onload event在很多時候都不會被呼叫。
經過測試後發現改成以下寫法就沒問題了
<img onload="checkImage" src="test.jpg" />
推測是因為cache導致onload event還沒執行到,圖已經載完了。
標籤:
html,
javascript
2012年12月7日 星期五
530 User xxxxx may not use FTP, mac os server
我在Mountain lion server.app下建立一個新用戶(沒有家目錄),
並且妥當的設定了FTP文件夾的權限。
然而很不幸的,在ftp連線時總是得到以下錯誤回應:
'530 User <account> may not use FTP.'
解決辦法如下:
Server app -> Accounts -> Users ->在context menu選擇使用者
-> Advanced Options -> Login shell
->將Services only帳號預設的 /user/bin/false 改成 /bin/sh
大功告成!!
標籤:
ftp,
mac os x server
訂閱:
文章 (Atom)