phpStudy集成了多種web服務的綜合配置,如經典的apache+mysql、nginx+mysql等,在使用apache+mysql時,希望能夠使用lua腳本,於是利用配置選項,啟用lua模塊,如下圖
但是經過這樣的配置後,再重啟apache服務時,卻無法正常使用lua腳本。lua測試代碼如下
require "apache2" function handle(r) r.content_type = "text/html" r:write "Hello World from mod_lua." return apache2.OK end可是在浏覽器打開時,卻是得到了這樣的結果,見下圖
vcWxvsO709Cxu9a00NCjrLb4yse1sbPJwcvG1c2otcTOxLG+tsHIoc/Uyr61vcHL5K/AwMb31tCho8TH1eLKx8qyw7TOyszixNijvzwvcD4KPHA+vq25/bLp1dKjrL+0tb3By9K7xqrOxNXC1tDLtbW9YXBhY2hl1tDG9NPDbHVhxKO/6bXEzsTVwqGjzsTVwtbQzOG1vdTaYXBhY2hlMi400tTJz7XEsOaxvtbQ0tG+rcTa1sPBy2x1YbXExKO/6aOsztLDx9a70OjSqr340NDSu9CpxeTWw77Nv8nS1MHLoaPIu7rzsunBy8/CcGhwU3R1ZHmwstewyrHL+bT4tcRhcGFjaGXKxzIuNLDmsb61xKOsy/nS1MTa1sPBy2x1YcSjv+mho8/Cw+bKx8Xk1sOyvdbooaM8L3A+CjxwPjEu1NpwaHBTdHVkeVxBcGFjaGVcY29uZs/C1dK1vWh0dHBkLmNvbmbF5NbDtbWjrL2rTG9hZE1vZHVsZSBsdWFfbW9kdWxlIG1vZHVsZXMvbW9kX2x1YS5zb8eww+a1xCO6xciltfSjqCO6xcrH16LKzbHqvMejqaGjPC9wPgo8cD4yLtTaxeTWw7XE1+6688PmzO3Jz2x1YcSjv+m0psDtz+5BZGRIYW5kbGVyIGx1YS1zY3JpcHQgLmx1YaGjPC9wPgo8cD4zLrGjtObF5NbDPC9wPgo8cD40LtTacGhwc3R1ZHnW0NbYxvS3/s7xoaM8L3A+CjxwPjUu1Nm0zrTyv6poZWxsby5sdWGy4srU0rOho9TL0NDV/bOjo6y94bn7yOfPws28oaM8L3A+CjxwPjxpbWcgc3JjPQ=="http://www.Bkjia.com/uploadfile/Collfiles/20131209/20131209104641156.jpg" alt="">
至此,phpstudy起用lua模塊的配置完畢。