Temat: Lighttpd + php5 = nie działa

Może tu mi ktoś wreszcie pomoże.

Mam blackfire 10.03 na mikrotik routerboard 133C (adm5120_mipsel)

Postanowiłem sobie zaserwować lighttpd+php5 dokładnie z tego tutoriala:
http://eko.one.pl/?p=openwrt-php

Generalnie wszystko pięknie funguje, lecz nie działa php. Po zapodaniu do katalogu pliczku index.php na przemian wyskakuje raz pusta strona raz "500 - Internal Server Error"


/www1/index.php

<html>
<?php 
echo "to jest php";
?>
</html>

/etc/lighttpd/lighttpd.conf

# lighttpd configuration file                                                     
#                                                                                 
## modules to load                                                                
# all other module should only be loaded if really neccesary                                   
# - saves some time                                                                            
# - saves memory                                                                               
server.modules = (                                                                             
#       "mod_rewrite",                                                                         
#       "mod_redirect",                                                                        
#       "mod_alias",                                                                           
#       "mod_auth",                                                                            
#       "mod_status",                                                                          
#       "mod_setenv",                                                                          
#       "mod_fastcgi",                                                                         
#       "mod_proxy",                                                                           
#       "mod_simple_vhost",                                                                    
        "mod_cgi",                                                                             
#       "mod_ssi",                                                                             
#       "mod_usertrack",                                                                       
#       "mod_expire",                                                                          
#       "mod_webdav"                                                                           
)                                                                                              
                                                                                               
# force use of the "write" backend (closes: #2401)                                             
server.network-backend = "write"                                                               
                                                                                               
## a static document-root, for virtual-hosting take look at the                                
## server.virtual-* options                                                                    
server.document-root = "/www1/"                                                                
                                                                                               
## where to send error-messages to                                                             
#server.errorlog = "/var/log/lighttpd/error.log"                                               
                                                                                               
## files to check for if .../ is requested                                                     
index-file.names = ( "index.html", "default.html", "index.htm", "index.php" )                  
                                                                                               
## mimetype mapping 
mimetype.assign = (                                                               
        ".pdf"   => "application/pdf",                                            
        ".class" => "application/octet-stream",                                   
        ".pac"   => "application/x-ns-proxy-autoconfig",                                       
        ".swf"   => "application/x-shockwave-flash",                                           
        ".wav"   => "audio/x-wav",                                                             
        ".gif"   => "image/gif",                                                               
        ".jpg"   => "image/jpeg",                                                              
        ".jpeg"  => "image/jpeg",                                                              
        ".png"   => "image/png",                                                               
        ".css"   => "text/css",                                                                
        ".html"  => "text/html",                                                               
        ".htm"   => "text/html",                                                               
        ".js"    => "text/javascript",                                                         
        ".txt"   => "text/plain",                                                              
        ".dtd"   => "text/xml",                                                                
        ".xml"   => "text/xml"                                                                 
 )                                                                                             
                                                                                               
## Use the "Content-Type" extended attribute to obtain mime type if possible                   
#mimetypes.use-xattr = "enable"                                                                
                                                                                               
## send a different Server: header                                                             
## be nice and keep it at lighttpd                                                             
#server.tag = "lighttpd"                                                                       
                                                                                               
$HTTP["url"] =~ "\.pdf$" {                                                                     
        server.range-requests = "disable"                                                      
}                                                                                              
                                                                                               
##                                                                                             
# which extensions should not be handle via static-file transfer                               
#                                                                                              
# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi                            
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )                                    
                                                                                               
######### Options that are good to be but not neccesary to be changed #######                  
                                                                                               
## bind to port (default: 80)                                                                  
#server.port = 81  
## bind to localhost (default: all interfaces)                                                 
#server.bind = "localhost"                                                                     
                                                                                               
## error-handler for status 404                                                                
#server.error-handler-404 = "/error-handler.html"                                              
#server.error-handler-404 = "/error-handler.php"                                               
                                                                                               
## to help the rc.scripts                                                                      
server.pid-file = "/var/run/lighttpd.pid"                                                      
                                                                                               
                                                                                               
###### virtual hosts                                                                           
##                                                                                             
##   If you want name-based virtual hosting add the next three settings and load               
##   mod_simple_vhost                                                                          
##                                                                                             
## document-root =                                                                             
##   virtual-server-root + virtual-server-default-host + virtual-server-docroot or             
##   virtual-server-root + http-host + virtual-server-docroot                                  
##                                                                                             
#simple-vhost.server-root = "/home/weigon/wwwroot/servers/"                                    
#simple-vhost.default-host = "grisu.home.kneschke.de"                                          
#simple-vhost.document-root = "/pages/"                                                        
                                                                                               
                                                                                               
##                                                                                             
## Format: <errorfile-prefix><status>.html                                                     
## -> ..../status-404.html for 'File not found'                                                
#server.errorfile-prefix = "/www/error-"                                                       
                                                                                               
## virtual directory listings                                                                  
#server.dir-listing = "enable"                                                                 
                                                                                               
## send unhandled HTTP-header headers to error-log                                             
#debug.dump-unknown-headers = "enable"                                                         
                                                                                               
### only root can use these options                                                            
#  
# chroot() to directory (default: no chroot() )                                   
#server.chroot = "/"                                                              
                                                                                  
## change uid to <uid> (default: don't care)                                                   
#server.username = "nobody"                                                                    
#                                                                                              
server.upload-dirs = ( "/tmp" )                                                                
                                                                                               
## change uid to <uid> (default: don't care)                                                   
#server.groupname = "nobody"                                                                   
                                                                                               
#### compress module                                                                           
#compress.cache-dir          = "/dev/null/"                                                    
#compress.filetype           = ("text/plain", "text/html")                                     
                                                                                               
#### proxy module                                                                              
## read proxy.txt for more info                                                                
#proxy.server = (                                                                              
#       ".php" => (                                                                            
#               "localhost" => (                                                               
#                       "host" => "192.168.0.101",                                             
#                       "port" => 80                                                           
#               )                                                                              
#       )                                                                                      
#)                                                                                             
                                                                                               
#### fastcgi module                                                                            
## read fastcgi.txt for more info                                                              
#fastcgi.server = (                                                                            
#       ".php" => (                                                                            
#               "localhost" => (                                                               
#                       "socket" => "/tmp/php-fastcgi.socket",                                 
#                       "bin-path" => "/usr/local/bin/php"                                     
#               )                                                                              
#       )                                                                                      
#)                                                                                             
                                                                                               
#### CGI module                                                                                
#cgi.assign = ( ".pl"  => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )                         
cgi.assign = ( ".php" => "/usr/bin/php-cgi" )   

#### SSL engine                                                                   
#ssl.engine = "enable"                                                            
#ssl.pemfile = "server.pem"                                                                    
                                                                                               
#### status module                                                                             
#status.status-url = "/server-status"                                                          
#status.config-url = "/server-config"                                                          
                                                                                               
#### auth module                                                                               
## read authentification.txt for more info                                                     
#auth.backend = "plain"                                                                        
#auth.backend.plain.userfile = "lighttpd.user"                                                 
#auth.backend.plain.groupfile = "lighttpd.group"                                               
#auth.require = (                                                                              
#       "/server-status" => (                                                                  
#               "method"  => "digest",                                                         
#               "realm"   => "download archiv",                                                
#               "require" => "group=www|user=jan|host=192.168.2.10"                            
#       ),                                                                                     
#       "/server-info" => (                                                                    
#               "method"  => "digest",                                                         
#               "realm"   => "download archiv",                                                
#               "require" => "group=www|user=jan|host=192.168.2.10"                            
#       )                                                                                      
#)                                                                                             
                                                                                               
#### url handling modules (rewrite, redirect, access)                                          
#url.rewrite = ( "^/$" => "/server-status" )                                                   
#url.redirect = ( "^/wishlist/(.+)" => "[url]http://www.123.org/$1[/url]" )                               
                                                                                               
#### both rewrite/redirect support back reference to regex conditional using %n                
#$HTTP["host"] =~ "^www\.(.*)" {                                                               
#       url.redirect = ( "^/(.*)" => "http://%1/$1" ) 
#}                                                                                
                                                                                  
#### expire module                                                                
#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
                                                                                               
#### ssi                                                                                       
#ssi.extension = ( ".shtml" )                                                                  
                                                                                               
#### setenv                                                                                    
#                                                                                 
server.upload-dirs = ( "/tmp" )                                                   
## change uid to <uid> (default: don't care)                                      
#server.username = "nobody"                                                       
#                                                                                 
magic_quotes_sybase = Off                                                                        
                                                                                  
## change uid to <uid> (default: don't care)                                      
#server.username = "nobody"                                                       
#                                                                                 
server.upload-dirs = ( "/tmp" )                                                   
                                                                                  
## change uid to <uid> (default: don't care)                                      
#server.groupname = "nobody"                                                      
                                                                                  
#### compress module                                                              
#compress.cache-dir          = "/dev/null/"                                       
#compress.filetype           = ("text/plain", "text/html")                        
                                                                                  
#### proxy module                                                                 
## read proxy.txt for more info                                                   
#proxy.server = (                                                                 
#       ".php" => (                                                               
#               "localhost" => (                                                  
#                       "host" => "192.168.0.101",                                
#                       "port" => 80                                              
#               )                                                                 
#       )                                                                         
#)                                                                                
                                                                                  
#### fastcgi module                                                               
## read fastcgi.txt for more info                                                 
#fastcgi.server = (                                                               
#       ".php" => (                                                               
#               "localhost" => (                                                  
#                       "socket" => "/tmp/php-fastcgi.socket",                    
#                       "bin-path" => "/usr/local/bin/php"                        
#               )                                                                 
#       )                                                                         
#)                                                                                
                                                                                  
#}                                                                                
                                                                                  
#### expire module                                                                
#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
                                                                                               
#### ssi                                                                                       
#ssi.extension = ( ".shtml" )                                                                  
                                                                                               
#### setenv                                                                                    
#setenv.add-request-header  = ( "TRAV_ENV" => "mysql://user@host/db" )                         
#setenv.add-response-header = ( "X-Secret-Message" => "42" )                                   
                                                                                               
#### variable usage:                                                                           
## variable name without "." is auto prefixed by "var." and becomes "var.bar"                  
#bar = 1                                                                                       
#var.mystring = "foo"                                                                          
                                                                                               
## integer add                                                                                 
#bar += 1                                                                                      
## string concat, with integer cast as string, result: "[url=http://www.foo1.com]www.foo1.com[/url]"                          
#server.name = "www." + mystring + var.bar + ".com"                                            
## array merge                                                                                 
#index-file.names = (foo + ".php") + index-file.names                                          
#index-file.names += (foo + ".php")                                                            
                                                                                               
#### include                                                                                   
#include /etc/lighttpd/lighttpd-inc.conf                                                       
## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"                         
#include "lighttpd-inc.conf"                                                                   
                                                                                               
#### include_shell                                                                             
#include_shell "echo var.a=1"                                                                  
## the above is same as:                                                                       
#var.a=1                                                                                       
                                                                                               
#### webdav                                                                                    
#$HTTP["url"] =~ "^/webdav($|/)" {                                                             
# webdav.activate = "enable"                                                                   
# webdav.is-readonly = "enable"                                                                
# webdav.sqlite-db-name = "/var/run/lighttpd-webdav-lock.db"                                   
#}

/etc/php.ini

[PHP]

zend.ze1_compatibility_mode = Off

; Language Options

engine = On
;short_open_tag = Off
precision    =  12
y2k_compliance = On
output_buffering = Off
;output_handler =
zlib.output_compression = Off
;zlib.output_compression_level = -1
;zlib.output_handler =
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 100
allow_call_time_pass_reference = On

safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
;open_basedir =
disable_functions =
disable_classes =

; Colors for Syntax Highlighting mode.  Anything that's acceptable in
; <span style="color: ???????"> would work.
;highlight.string  = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.bg      = #FFFFFF
;highlight.default = #0000BB
;highlight.html    = #000000

;ignore_user_abort = On
;realpath_cache_size = 16k
;realpath_cache_ttl = 120                                            
                                                                     
; Miscellaneous                                                      
                                                                     
expose_php = On                                                      
                                              
; Resource Limits                                                    
                                                                     
max_execution_time = 30 ; Maximum execution time of each script, in seconds.
max_input_time = 60     ; Maximum amount of time each script may spend parsing request data.
;max_input_nesting_level = 64                                                               
memory_limit = 8M       ; Maximum amount of memory a script may consume.                    
                                                                                            
; Error handling and logging                                                                
                                                                                            
; Error Level Constants:                                                                    
; E_ALL             - All errors and warnings (includes E_STRICT as of PHP 6.0.0)           
; E_ERROR           - fatal run-time errors                                                 
; E_RECOVERABLE_ERROR  - almost fatal run-time errors                                       
; E_WARNING         - run-time warnings (non-fatal errors)                                  
; E_PARSE           - compile-time parse errors                                             
; E_NOTICE          - run-time notices (these are warnings which often result               
;                     from a bug in your code, but it's possible that it was                
;                     intentional (e.g., using an uninitialized variable and                
;                     relying on the fact it's automatically initialized to an              
;                     empty string)                                              
; E_STRICT                      - run-time notices, enable to have PHP suggest changes      
;                     to your code which will ensure the best interoperability              
;                     and forward compatibility of your code                                
; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup                  
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's                   
;                     initial startup                                                       
; E_COMPILE_ERROR   - fatal compile-time errors                                             
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)                              
; E_USER_ERROR      - user-generated error message                                          
; E_USER_WARNING    - user-generated warning message                                        
; E_USER_NOTICE     - user-generated notice message                                         
; E_DEPRECATED      - warn about code that will not work in future versions                 
;                     of PHP                                                                
; E_USER_DEPRECATED - user-generated deprecation warnings                                   
;                                                           
; Common Values:                                                                            
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.) 
;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)                     
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)            
;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)   
; Default Value: E_ALL & ~E_NOTICE                                                          
error_reporting  =  E_ALL & ~E_NOTICE & ~E_STRICT                                           
                                                                                            
display_errors = On                                                                         
display_startup_errors = Off                                                                
log_errors = Off                                                                            
log_errors_max_len = 1024                                                                   
ignore_repeated_errors = Off                                                                
ignore_repeated_source = Off                                                                
report_memleaks = On                                                                        
;report_zend_debug = 0                                                                      
track_errors = Off                                                                          
;html_errors = Off                                                                          
;docref_root = "/phpmanual/"                                                                
;docref_ext = .html                                                                         
;error_prepend_string = "<font color=#ff0000>"                                              
;error_append_string = "</font>"                                                            
; Log errors to specified file.                                                             
;error_log = /var/log/php_errors.log                                                        
; Log errors to syslog.                                                                    
;error_log = syslog                                                                         
                                                                                            
; Data Handling                                                                             
                                                                                            
;arg_separator.output = "&amp;"                                                             
;arg_separator.input = ";&"                                                                 
variables_order = "EGPCS"                                                                   
request_order = "GP"                                                                        
register_globals = Off                                                                      
register_long_arrays = Off                                                                  
register_argc_argv = On                                                                     
auto_globals_jit = On                                                                       
post_max_size = 8M                                                                          
;magic_quotes_gpc = Off                                                                     
magic_quotes_runtime = Off    
magic_quotes_sybase = Off                                                                   
auto_prepend_file =                                                                         
auto_append_file =                                                                          
default_mimetype = "text/html"                                                              
;default_charset = "iso-8859-1"                                                             
;always_populate_raw_post_data = On                                                         
                                                                                            
; Paths and Directories                                                                     
                                                                                            
; UNIX: "/path1:/path2"                                                                     
;include_path = ".:/php/includes"                                                           
doc_root = "/www1"                                                                          
user_dir =                                                                                  
extension_dir = "/usr/lib/php"                                                              
enable_dl = On                                                                              
;cgi.force_redirect = 0                                                                     
;cgi.nph = 1                                                                                
;cgi.redirect_status_env = ;                                                                
cgi.fix_pathinfo=1                                                                          
;fastcgi.impersonate = 1;                                                                   
;fastcgi.logging = 0                                                                        
;cgi.rfc2616_headers = 0                                                                    
                                                                                            
; File Uploads                                                                              
                                                                                            
file_uploads = On                                                                          
upload_tmp_dir = "/tmp"                                                                     
upload_max_filesize = 2M                                                                    
max_file_uploads = 20                                                                       
                                                                                            
; Fopen wrappers                                                                            
                                                                                            
allow_url_fopen = On                                                                        
allow_url_include = Off                                                                     
;from="john@doe.com"                                                                        
;user_agent="PHP"                                                                           
default_socket_timeout = 60                                                                 
;auto_detect_line_endings = Off                                                             
                                                                                            
; Dynamic Extensions                                                                        
                                                                                                                               
;extension=ctype.so                                                                         
;extension=curl.so                                                                          
;extension=dom.so                                                                           
;extension=exif.so                                                                          
;extension=ftp.so                                                                           
;extension=gd.so                                                                            
;extension=gmp.so                                                                           
;extension=hash.so                                                                          
;extension=iconv.so                                                                         
;extension=json.so                                                                          
;extension=ldap.so                                                                          
;extension=mbstring.so                                                                      
;extension=mcrypt.so                                                                        
;extension=mysql.so                                                                         
;extension=openssl.so                                                                       
;extension=pcre.so                                                                          
;extension=pdo.so                                                                           
;extension=pdo-mysql.so                                                                     
;extension=pdo-pgsql.so                                                                     
;extension=pdo_sqlite.so                                                                    
;extension=pgsql.so                                                                         
;extension=session.so                                                                       
;extension=soap.so                                                                          
;extension=sockets.so                                                                       
;extension=sqlite.so                                                                       
;extension=sqlite3.so                                                                       
;extension=tokenizer.so                                                                     
;extension=xml.so                                                                           
;extension=xmlreader.so                                                                     
;extension=xmlwriter.so                                                                     
                                                                                            
; Module Settings                                                                           
                                                                                            
[APC]                                                                                       
apc.enabled = 1                                                                             
apc.shm_segments = 1    ;The number of shared memory segments to allocate for the compiler cache.
apc.shm_size = 4        ;The size of each shared memory segment in MB.                           
                                                                                                 
[Date]                                                                                           
;date.timezone =                     
;date.default_latitude = 31.7667                                                                 
;date.default_longitude = 35.2333                                                                
;date.sunrise_zenith = 90.583333                                                                 
;date.sunset_zenith = 90.583333                                                                  
                                                                                                 
[filter]                                                                                         
;filter.default = unsafe_raw                                                                     
;filter.default_flags =                                                                          
                                                                                                 
[iconv]                                                                                          
;iconv.input_encoding = ISO-8859-1                                                               
;iconv.internal_encoding = ISO-8859-1                                                            
;iconv.output_encoding = ISO-8859-1                                                              
                                                                                                 
[sqlite]                                                                                         
;sqlite.assoc_case = 0                                                                           
                                                                                                 
[sqlite3]                                                                                        
;sqlite3.extension_dir =                                                                         
                                                                                                 
[Pdo_mysql]                                                                                      
pdo_mysql.cache_size = 2000                                                                      
pdo_mysql.default_socket=                                                                        
                                                                                                 
[MySQL]                                                                                          
mysql.allow_local_infile = On                                                                    
mysql.allow_persistent = On                                                                      
mysql.cache_size = 2000                                                                          
mysql.max_persistent = -1                                                                        
mysql.max_links = -1                                                                             
mysql.default_port =                                                                             
mysql.default_socket =                                                                           
mysql.default_host =                                                                             
mysql.default_user =                                                                             
mysql.default_password =                                                                         
mysql.connect_timeout = 60                                                                       
mysql.trace_mode = Off                                                                           
                                                                                                 
[PostgresSQL]                                                                                    
pgsql.allow_persistent = On                                                                      
pgsql.auto_reset_persistent = Off                
pgsql.max_persistent = -1                                                                        
pgsql.max_links = -1                                                                             
pgsql.ignore_notice = 0                                                                          
pgsql.log_notice = 0                                                                             
                                                                                                 
[Session]                                                                                        
session.save_handler = files                                                                     
session.save_path = "/tmp"                                                                       
session.use_cookies = 1                                                                          
;session.cookie_secure =                                                                         
session.use_only_cookies = 1                                                                     
session.name = PHPSESSID                                                                         
session.auto_start = 0                                                                           
session.cookie_lifetime = 0                                                                      
session.cookie_path = /                                                                          
session.cookie_domain =                                                                          
session.cookie_httponly =                                                                        
session.serialize_handler = php                                                                  
session.gc_probability = 1                                                                       
session.gc_divisor     = 100                                                                     
session.gc_maxlifetime = 1440                                                                    
session.bug_compat_42 = On                                                                       
session.bug_compat_warn = On                                                                     
session.referer_check =                                                                          
session.entropy_length = 0                                                                       
;session.entropy_file = /dev/urandom                                                             
session.entropy_file =                                                                           
;session.entropy_length = 16                                                                     
session.cache_limiter = nocache                                                                  
session.cache_expire = 180                                                                       
session.use_trans_sid = 0                                                                        
session.hash_function = 0                                                                        
session.hash_bits_per_character = 4                                                              
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="                       
                                                                                                 
[mbstring]                                                                                       
;mbstring.language = Japanese                                                                    
;mbstring.internal_encoding = EUC-JP                                                             
;mbstring.http_input = auto                                                                      
;mbstring.http_output = SJIS                                                                     
;mbstring.encoding_translation = Off                  
;mbstring.detect_order = auto                                                                    
;mbstring.substitute_character = none;                                                           
;mbstring.func_overload = 0                                                                      
;mbstring.strict_detection = Off                                                                 
;mbstring.http_output_conv_mimetype=                                                             
;mbstring.script_encoding=                                                                       
                                                                                                 
[gd]                                                                                             
;gd.jpeg_ignore_warning = 0                                                                      
                                                                                                 
[exif]                                                                                           
;exif.encode_unicode = ISO-8859-15                                                               
;exif.decode_unicode_motorola = UCS-2BE                                                          
;exif.decode_unicode_intel    = UCS-2LE                                                          
;exif.encode_jis =                                                                               
;exif.decode_jis_motorola = JIS                                                                  
;exif.decode_jis_intel    = JIS                                                                  
                                                                                                 
[soap]                                                                                           
soap.wsdl_cache_enabled=1                                                                        
soap.wsdl_cache_dir="/tmp"                                                                       
soap.wsdl_cache_ttl=86400                                                                        
soap.wsdl_cache_limit = 5                                                                        
                                                                                                 
[sysvshm]                                                                                        
;sysvshm.init_mem = 10000                                                                        
                                                                                                 
[ldap]                                                                                           
ldap.max_links = -1                                                                              
                                                                                                 
[mcrypt]                                                                                         
;mcrypt.algorithms_dir=                                                                          
;mcrypt.modes_dir=                   

zainstalowane pakiety:
lighttpd
lighttpd-mod-cgi
php5
php5-cgi

Czy możliwe jest że któryś z nich nie jest skompilowany na tą platformę?
(tutaj podobny problem) https://forum.openwrt.org/viewtopic.php?id=10330

Wszystko pobrane było z repo:
http://downloads.openwrt.org/backfire/1 … /packages/

Pomocy! smile

2

Odp: Lighttpd + php5 = nie działa

Noi zrobione big_smile Okazało się że przeoczyłem pakiet "libsqlite3"!!!!!!!!!!!!!!!!!!!!!!!!!!
AHH już 3 dzień nad tym siedzę i wreszcie big_smile

PS.
O co chodzi z tą kompilacją własnych pakietów? Jest to możliwe w ogóle na ruterze który ma 160MHz i 16MB Ramu?

3

Odp: Lighttpd + php5 = nie działa

Ruter kompilował by to ze trzy dni smile.
Chodzi o samodzielną budowę systemu na normalnym komputerze.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

4

Odp: Lighttpd + php5 = nie działa

Podepne sie pod temat: Mam wgrany obraz z gargoyle. Probowalem postepowac wg tutoriala i oto co mi wyszlo:

root@Gargoyle:~# opkg update
Downloading http://downloads.openwrt.org/backfire/10.03.1-rc4/ar71xx/packages/Packages.gz.
Inflating http://downloads.openwrt.org/backfire/10.03.1-rc4/ar71xx/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/packages.
root@Gargoyle:~# opkg install php5 php5-cgi libsqlite3
Installing php5 (5.3.1-4) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1-rc4/ar71xx/packages/php5_5.3.1-4_ar71xx.ipk.
Installing libpcre (8.10-1) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1-rc4/ar71xx/packages/libpcre_8.10-1_ar71xx.ipk.
Installing zlib (1.2.3-5) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1-rc4/ar71xx/packages/zlib_1.2.3-5_ar71xx.ipk.
Installing php5-cgi (5.3.1-4) to root...
Installing libsqlite3 (3.7.0-1) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1-rc4/ar71xx/packages/libsqlite3_3.7.0-1_ar71xx.ipk.
Configuring libpcre.
Configuring zlib.
Configuring php5.
Configuring libsqlite3.
Collected errors:
 * verify_pkg_installable: Only have 2412kb available on filesystem /overlay, pkg php5-cgi needs 2572
 * opkg_install_cmd: Cannot install package php5-cgi.

Sciagnalem obraz od nowa, zaktualizowalem firmware zeby wykluczyc zla konfiguracje, ale efekt jest taki sam. Jakies pomysly?

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

5

Odp: Lighttpd + php5 = nie działa

Only have 2412kb available on filesystem /overlay, pkg php5-cgi needs 2572

Nie ma miejsca we flash na instalację php5. Potrzebujesz extroota, nośnik na sd,usb czy nfs żeby to w ogóle zainstalować.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

6

Odp: Lighttpd + php5 = nie działa

Jesli mozna, to w tutorialu http://eko.one.pl/?p=openwrt-php pisze: "Oczywiście należy pamiętać o dodaniu także zainstalowanych wcześniej modułów. Reszta opcji wg uznania."
Czy mozna nieco jasniej, bo nie zajarzylem...

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

7

Odp: Lighttpd + php5 = nie działa

w php.ini. Jeżeli zainstalowałeś moduły do php, to w ini trzeba jeszcze usunąć # przed nazwą danego modułu bo po prostu nie zostanie wczytany.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

8

Odp: Lighttpd + php5 = nie działa

Hmm... Cos nie chce mi zadzialac

# uci add httpd httpd

Mam zainstalowany lighttpd.

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

9

Odp: Lighttpd + php5 = nie działa

Ale lighttpd nie konfiguruje się przez uci/httpd. uhttpd tak.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

10

Odp: Lighttpd + php5 = nie działa

# opkg install uhttpd
Installing uhttpd (19) to root...
Downloading http://downloads.openwrt.org/backfire/10.03.1-rc4/ar71xx/packages/uhttpd_19_ar71xx.ipk.
Configuring uhttpd.
# uci add httpd httpd
uci: Entry not found

Chyba cos jeszcze pobaranilem...

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

11

Odp: Lighttpd + php5 = nie działa

uci show uhttpd  jak już

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

12

Odp: Lighttpd + php5 = nie działa

Zaraz, czegos nie rozumiem: Przeszedlem poradnik do momentu Konfiguracja serwera www, ale nie dziala mi to co wyzej. Co powinienem doinstalowac?

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

13

Odp: Lighttpd + php5 = nie działa

Ale wszedłeś w sekcje odnoście httpd, który był w 8.09.2. To sobie darujesz, idź do sekcji o lighttpd.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

14 (edytowany przez patryk 2010-12-22 21:26:32)

Odp: Lighttpd + php5 = nie działa

tu masz całą konfiguracje lighttpd z php-cgi i BEZ baz danych
zmien sobie server.document-root = "/www/" na twoj katalog e stronkami i musi dzialac
zostaw php.ini (ew. ustaw sobie strefe czasu na 'CET') jak jest, tym kodem zastąp zawartosc lighttpd.conf i ma hulać po restarcie serwera.

# lighttpd configuration file
# 
## modules to load
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory
server.modules = ( 
#    "mod_rewrite", 
#    "mod_redirect", 
#    "mod_alias", 
#    "mod_auth", 
#    "mod_status", 
#    "mod_setenv",
#    "mod_fastcgi",
#    "mod_proxy",
#    "mod_simple_vhost",
    "mod_cgi",
#    "mod_ssi",
#    "mod_usertrack",
#    "mod_expire",
#    "mod_webdav"
)

# force use of the "write" backend (closes: #2401)
server.network-backend = "write"

## a static document-root, for virtual-hosting take look at the 
## server.virtual-* options
server.document-root = "/www/"
server.follow-symlink = "enable"
server.dir-listing = "enable"

## where to send error-messages to
#server.errorlog = "/var/log/lighttpd/error.log"

## files to check for if .../ is requested
index-file.names = ( "index.html", "index.php", "index.htm", )

cgi.assign = (
    ".php" => "/usr/bin/php-cgi",
    ".sh"    => "/bin/sh"
)

## mimetype mapping
mimetype.assign = (  
    ".pdf"   => "application/pdf",
    ".class" => "application/octet-stream",
    ".pac"   => "application/x-ns-proxy-autoconfig",
    ".swf"   => "application/x-shockwave-flash",
    ".wav"   => "audio/x-wav",
    ".gif"   => "image/gif",
    ".jpg"   => "image/jpeg",
    ".jpeg"  => "image/jpeg",
    ".png"   => "image/png",
    ".css"   => "text/css",
    ".html"  => "text/html",
    ".htm"   => "text/html",
    ".js"    => "text/javascript",
    ".txt"   => "text/plain",
    ".dtd"   => "text/xml",
    ".xml"   => "text/xml"
 )

## Use the "Content-Type" extended attribute to obtain mime type if possible
#mimetypes.use-xattr = "enable"

## send a different Server: header
## be nice and keep it at lighttpd
server.tag = "lighttpd"

$HTTP["url"] =~ "\.pdf$" {
    server.range-requests = "disable"
}

##
# which extensions should not be handle via static-file transfer
#
# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

######### Options that are good to be but not neccesary to be changed #######

## bind to port (default: 80)
#server.port = 81

## bind to localhost (default: all interfaces)
#server.bind = "localhost"

## error-handler for status 404
#server.error-handler-404 = "/error-handler.html"
#server.error-handler-404 = "/error-handler.php"

## to help the rc.scripts
server.pid-file = "/var/run/lighttpd.pid"


###### virtual hosts
##
##   If you want name-based virtual hosting add the next three settings and load
##   mod_simple_vhost
##
## document-root =
##   virtual-server-root + virtual-server-default-host + virtual-server-docroot or
##   virtual-server-root + http-host + virtual-server-docroot
##
#simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
#simple-vhost.default-host = "grisu.home.kneschke.de"
#simple-vhost.document-root = "/pages/"


## 
## Format: <errorfile-prefix><status>.html
## -> ..../status-404.html for 'File not found'
#server.errorfile-prefix = "/www/error-"

## virtual directory listings
#server.dir-listing = "enable"

## send unhandled HTTP-header headers to error-log
#debug.dump-unknown-headers = "enable"

### only root can use these options
#
# chroot() to directory (default: no chroot() )
#server.chroot = "/"

## change uid to <uid> (default: don't care)
#server.username = "nobody"
#
server.upload-dirs = ( "/tmp" )

## change uid to <uid> (default: don't care)
#server.groupname = "nobody"

#### compress module
#compress.cache-dir          = "/dev/null/"
#compress.filetype           = ("text/plain", "text/html")

#### proxy module
## read proxy.txt for more info
#proxy.server = (
#    ".php" => (
#        "localhost" => (
#            "host" => "192.168.0.101",
#            "port" => 80
#        )
#    )
#)

#### fastcgi module
## read fastcgi.txt for more info
#fastcgi.server = (
#    ".php" => (
#        "localhost" => (
#            "socket" => "/tmp/php-fastcgi.socket",
#            "bin-path" => "/usr/local/bin/php"
#        )
#    )
#)

#### CGI module
#cgi.assign = ( ".pl"  => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )

#### SSL engine
#ssl.engine = "enable"
#ssl.pemfile = "server.pem"

#### status module
#status.status-url = "/server-status"
#status.config-url = "/server-config"

#### auth module
## read authentification.txt for more info
#auth.backend = "plain"
#auth.backend.plain.userfile = "/etc/lighttpd/lighttpd.user"
#auth.backend.plain.groupfile = "/etc/lighttpd/lighttpd.group"
#auth.require = (
#    "/server-status" => ( 
#        "method"  => "digest",
#        "realm"   => "download archiv",
#        "require" => "group=www|user=jan|host=192.168.2.10"
#    ),
#    "/prv" => ( 
#        "method"  => "digest",
#        "realm"   => "download archiv",
#        "require" => "user=dave"
#    )
#)

#### url handling modules (rewrite, redirect, access)
#url.rewrite = ( "^/$" => "/server-status" )
#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )

#### both rewrite/redirect support back reference to regex conditional using %n
#$HTTP["host"] =~ "^www\.(.*)" {
#    url.redirect = ( "^/(.*)" => "http://%1/$1" )
#}

#### expire module
#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")

#### ssi
#ssi.extension = ( ".shtml" )

#### setenv
#setenv.add-request-header  = ( "TRAV_ENV" => "mysql://user@host/db" )
#setenv.add-response-header = ( "X-Secret-Message" => "42" )

#### variable usage:
## variable name without "." is auto prefixed by "var." and becomes "var.bar"
#bar = 1
#var.mystring = "foo"

## integer add
#bar += 1
## string concat, with integer cast as string, result: "www.foo1.com"
#server.name = "www." + mystring + var.bar + ".com"
## array merge
#index-file.names = (foo + ".php") + index-file.names
#index-file.names += (foo + ".php")

#### include
#include /etc/lighttpd/lighttpd-inc.conf
## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
#include "lighttpd-inc.conf"

#### include_shell
#include_shell "echo var.a=1"
## the above is same as:
#var.a=1

#### webdav
#$HTTP["url"] =~ "^/webdav($|/)" {
# webdav.activate = "enable"
# webdav.is-readonly = "enable"
# webdav.sqlite-db-name = "/var/run/lighttpd-webdav-lock.db"
#}

---edit---

sorki - ta konfiguracja jest na port 80, czyli jak masz gargoyle albo inne wynalazki, to musisz zmienic na inny (usuń '#' z przed 'server.port = XX' i zamien XX na nr portu na ktorym chcesz miec serwer)

15

Odp: Lighttpd + php5 = nie działa

No fajnie, dzieki, serwer wystartowal i nie pluje sie, ustawilem server.document-root = "/www1/", port 8080. Wchodze wiec na http://192.168.1.1:8080/ i pojawia sie to co chce. Teraz pytanko: Czy dam rade wejsc od strony WAN po https?

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

16

Odp: Lighttpd + php5 = nie działa

Jak byś go postawił na 443 i odblokował ten port na wan to tak.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

17

Odp: Lighttpd + php5 = nie działa

A tresc bedzie szyfrowana? Przez korporacyjne proxy przejdzie w postaci zaszyfrowanej?

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

18

Odp: Lighttpd + php5 = nie działa

Jak zrobisz https to tak

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

19

Odp: Lighttpd + php5 = nie działa

Czyli:
1. Trzeba cos jeszcze skonfigurowac, czy wystarczy tylko postawic na porcie 443?
2. Czy wystarczy w web-gui wybrac zdalny dostep po https, zeby port byl odblokowany?

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

20

Odp: Lighttpd + php5 = nie działa

1. Nie, samo postawienie na 443 nic nie daje. http://redmine.lighttpd.net/wiki/lighttpd/Docs:SSL się kłania.
2. Nie, trzeba wyłączyć go żeby nie wchodził na 443 a odblokować tylko port 443.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

21

Odp: Lighttpd + php5 = nie działa

http://www.crazymaze.de/smili/midi/fahne.gif

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

22

Odp: Lighttpd + php5 = nie działa

Nie przesadzaj. Masz tylko wygenerować certyfikat i go podpiąć pod serwer na 443. Na dole był link do "SimpleSSL", kilka linii na krzyż.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

23

Odp: Lighttpd + php5 = nie działa

Tylko chyba musze doinstalowac modul openssl. opkg list openssl nic nie daje. Jak to sie nazywa? Pytam, bo na stronce jest

openssl req -new -x509 -keyout lighttpd.pem -out lighttpd.pem -days 365 -nodes

wiec openssl musi byc.

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)

24

Odp: Lighttpd + php5 = nie działa

opkg install openssl-util

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

25 (edytowany przez badziewiak 2010-12-22 22:49:57)

Odp: Lighttpd + php5 = nie działa

Postepujac wg http://redmine.lighttpd.net/wiki/lightt … oSimpleSSL wygenerowalem co trzeba, wrzucilem do

/etc/lighttpd/certs

i wykomentowalem poprzednio odkomentowany

#server.port = 8080

i zrobilem

#### SSL engine
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/certs/lighttpd.pem"
}

ale rzuca mi sie:

/etc/init.d/lighttpd restart
2010-12-22 22:43:04: (network.c.345) can't bind to port:  80 Address already in use

Na zrowy rozsadek to bym dal port 443. Co robic?

MiniPC 6xRJ45 2Gb, N100, 16GB DDR5, 1TB NVMe (Gargoyle)
Linksys WRT3200ACM (Gargoyle)
Tp-link 1043NDv2 (Gargoyle)