icecoder / ICEcoder

Browser code editor awesomeness
http://icecoder.net
Other
1.42k stars 347 forks source link

php8 not ready? #959

Closed festuc closed 3 years ago

festuc commented 3 years ago

I just upgrade my dev platforms to php8, until then your program work perfect. But now, after try even to reinstall it, it don't save, or even i can set my preferences. What can i do?

mattpass commented 3 years ago

It sounds like it'd be some obscure server issue - maybe re file write permissions?

ICEcoder 8 has actually been developed mostly on a PHP 8 server (8.0.1) and overall works fine, especially re something as core as saving. Something else is likely the issue, could maybe look at PHP error logs to give a hint re what may be the problem?

If that doesn't help, within data/config-globa.php change "fileDirResOutput";s:4:"none" to "fileDirResOutput";s:4:"both" and when you save, in your dev tools Console tab, it should give a bit more info re what actions it's taking - perhaps something in there doesn't seem right?

(Pls note: There is an issue with Adminer (the database component) which is having some issues with PHP 8 right now, but I don't think that would stop you from saving successfully).

UPDATE: Adminer updated to latest version and so there is no Error 500 for it anymore.

festuc commented 3 years ago

1st thanks for your time! i really don't understand i do your tip, but i dont see nothing in console about this i show you a screen shot. ICEcodersaving of course i set all permisions to all icecoder directory to http user with 755 chmod When i save file it actually is saved. but is not show in red cross at top. and need to refresh all icecoder to disapear this red cross.

i make manualy data/backup and data/backup/localhost. and change lines in settings-screen to do that: becose in error.log said there is not a constant...

                        $wordCasings = [
                                'Ii' => "II",
                                'Ir' => "IR",
                                'Mdn' => "MDN",
                                'Ttcn' => "TTCN",
                                'Xq' => "XQ"
                        ];

after that i was able to set my settings again. but i do not understand you set up your php server in any way that allow you interpred unquoted strings are a strings and not constants? or do you have a standar php clean instalation? I make a new fresh installation in a dev env, arch + ngnix+ mariadb+ php + php-fpm with this php.ini

 cat /etc/php/php.ini  | egrep -v "(^;.*|^$)"
[PHP]
engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = -1
disable_functions =
disable_classes =
zend.enable_gc = On
expose_php = On
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
display_errors = On
display_startup_errors = On
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
html_errors = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
extension_dir = "/usr/lib/php/modules/"
enable_dl = Off
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
extension=curl
extension=gd
extension=iconv
extension=intl
extension=mysqli
extension=pdo_mysql
extension=sockets
extension=zip
[CLI Server]
cli_server.color = On
[Date]
[filter]
[iconv]
[intl]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgreSQL]
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
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
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 = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.sid_length = 26
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.sid_bits_per_character = 5
[Assertion]
zend.assertions = -1
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[dba]
[opcache]
[curl]
[openssl]

in ngnix i have this configuration :

server {
      server_name myserver.com
        location /{
                root /https/myserver.com/html;
                index index.php index.html;
                try_files $uri $uri/ /index.php?$args;
        }

        location ~ \.php$ {
            root    /https/myserver.com/html;
            include        fastcgi_params;
            fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /https/myserver.com/html/$fastcgi_script_name;
        }
        location ^~ /.well-known/acme-challenge/ {
  allow all;
  root /var/lib/letsencrypt/;
  default_type "text/plain";
  try_files $uri =404;
}

        listen 443;
    ssl_certificate /etc/letsencrypt/live/myserver.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/myserver.como/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
mattpass commented 3 years ago

Thanks for all the info. I think the first screenshot is actually leading us to the issue. There's some response data issue when you save - it seems it's not JSON, very likely an error message which should tell you what the issue is.

With your dev tools open, click on the Network tab, reload ICEcoder and then make a change in your editor and save. You should see in the left column a XHR request to file-control.php?action=save.... If you click that and then on the right side click the Response tab. This will show the response from your save request.

Here's mine... Screenshot from 2021-03-04 13-44-32

If you do the above you'll probably find an error message instead. Would be good to know what that is.

It sounds from your description the save is happening fine, but the data response back to ICEcoder probably contains an error message rather than JSON? (The lack of JSON data back in the response, causes JavaScript to error and so the red indicator light to not go out on the tab and very likely all JavaScript and therefore interactivity from there on to fail such as more saves).

Let me know if you get an error message - it'll very likely be the clue to what's going wrong.

mattpass commented 3 years ago

PS - thanks for pointing out the issue with array keys in wordCasings not being quoted! Not sure how that went unnoticed. Have fixed now in: https://github.com/icecoder/ICEcoder/commit/f79cc0336a79f09c3af54d7563c133da4bbb7a9f

mattpass commented 3 years ago

Hope you tracked down there issue here @festuc and thanks for pointing out the array key casing issue. Closing.