🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.php
6 messages
6 total messages Started by Jivanmukta Fri, 06 May 2022 05:47
problemik z require_once w PHP8/Ubuntu20
#232589
Author: Jivanmukta
Date: Fri, 06 May 2022 05:47
29 lines
1925 bytes
W pliku app/Config/Constants.php aplikacji z CodeIgniter4 mam:

...
$server = array('development' => 'localhost', 'testing' => 'hosting', 
'production' => 'hosting');   // też w scripts/constant.php
require_once $server[$_SERVER['CI_ENVIRONMENT']] . '_passwords.php';
require_once $server[$_SERVER['CI_ENVIRONMENT']] . '_constants.php';
echo 'Constants 1 ';
require_once 'webdep_constants.php';
echo 'Constants 2 ';
require_once 'other_constants.php';
echo 'Constants 3 ';
require_once 'errmsg_constants.php';
echo 'Constants 4 ';

Wyświetla się:
Constants 1

tzn. plik webdep_constants.php już się nie ładuje. Nie wiem dlaczego, bo 
mam:

robert@lenovo:~/Projekty/dirtyphp-website/app/Config$ ls -la *constants.php
-rw-rw---- 1 robert www-data 1574 sie 15  2021 errmsg_constants.php
-rw-rw---- 1 robert www-data  944 lis  5 06:16 hosting_constants.php
-rw-rw---- 1 robert www-data 1803 sie 15  2021 localhost_constants.php
-rw-rw---- 1 robert www-data 1086 maj  2 21:52 other_constants.php
-rw-rw---- 1 robert www-data 1031 sie 15  2021 webdep_constants.php

tzn. uprawnienia są takie same dla wszystkich plików.
Re: problemik z require_once w PHP8/Ubuntu20
#232590
Author: Jivanmukta
Date: Fri, 06 May 2022 06:11
3 lines
1056 bytes
W dniu 06.05.2022 o 07:47, Jivanmukta pisze:
> tzn. plik webdep_constants.php już się nie ładuje. 
Plik webdep_constants.php jest poprawny (sprawdziłem php -l).
Re: problemik z require_once w PHP8/Ubuntu20
#232591
Author: Jivanmukta
Date: Fri, 06 May 2022 07:16
11 lines
1149 bytes
Zmiana:

echo 'Constants 1 ';
require_once __DIR__ . '/webdep_constants.php';
echo 'Constants 2 ';
require_once __DIR__ . '/other_constants.php';
echo 'Constants 3 ';
require_once __DIR__ . '/errmsg_constants.php';
echo 'Constants 4 ';

nie pomaga.
Re: problemik z require_once w PHP8/Ubuntu20
#232592
Author: Jivanmukta
Date: Fri, 06 May 2022 07:30
1 lines
931 bytes
Zamiana na include_once też nie pomaga.
Re: problemik z require_once w PHP8/Ubuntu20
#232593
Author: Lemat
Date: Fri, 06 May 2022 07:46
37 lines
2660 bytes
W dniu 06.05.2022 o 07:47, Jivanmukta pisze:
> W pliku app/Config/Constants.php aplikacji z CodeIgniter4 mam:
> 
> ...
> $server = array('development' => 'localhost', 'testing' => 'hosting', 
> 'production' => 'hosting');   // też w scripts/constant.php
> require_once $server[$_SERVER['CI_ENVIRONMENT']] . '_passwords.php';
> require_once $server[$_SERVER['CI_ENVIRONMENT']] . '_constants.php';
> echo 'Constants 1 ';
> require_once 'webdep_constants.php';
> echo 'Constants 2 ';
> require_once 'other_constants.php';
> echo 'Constants 3 ';
> require_once 'errmsg_constants.php';
> echo 'Constants 4 ';
> 
> Wyświetla się:
> Constants 1
> 
> tzn. plik webdep_constants.php już się nie ładuje. Nie wiem dlaczego, bo 
> mam:
> 
> robert@lenovo:~/Projekty/dirtyphp-website/app/Config$ ls -la *constants.php
> -rw-rw---- 1 robert www-data 1574 sie 15  2021 errmsg_constants.php
> -rw-rw---- 1 robert www-data  944 lis  5 06:16 hosting_constants.php
> -rw-rw---- 1 robert www-data 1803 sie 15  2021 localhost_constants.php
> -rw-rw---- 1 robert www-data 1086 maj  2 21:52 other_constants.php
> -rw-rw---- 1 robert www-data 1031 sie 15  2021 webdep_constants.php
> 
> tzn. uprawnienia są takie same dla wszystkich plików.

ustaw error_reporting i display_errors w php.ini tak aby wyświetlało ci 
(wszystkie) błędy na tym środowisku testowycm.

-- 
Pozdrawiam
Lemat
Re: problemik z require_once w PHP8/Ubuntu20
#232594
Author: Jivanmukta
Date: Fri, 06 May 2022 08:28
39 lines
2904 bytes
W dniu 06.05.2022 o 09:46, Lemat pisze:
> W dniu 06.05.2022 o 07:47, Jivanmukta pisze:
>> W pliku app/Config/Constants.php aplikacji z CodeIgniter4 mam:
>>
>> ...
>> $server = array('development' => 'localhost', 'testing' => 'hosting', 
>> 'production' => 'hosting');   // też w scripts/constant.php
>> require_once $server[$_SERVER['CI_ENVIRONMENT']] . '_passwords.php';
>> require_once $server[$_SERVER['CI_ENVIRONMENT']] . '_constants.php';
>> echo 'Constants 1 ';
>> require_once 'webdep_constants.php';
>> echo 'Constants 2 ';
>> require_once 'other_constants.php';
>> echo 'Constants 3 ';
>> require_once 'errmsg_constants.php';
>> echo 'Constants 4 ';
>>
>> Wyświetla się:
>> Constants 1
>>
>> tzn. plik webdep_constants.php już się nie ładuje. Nie wiem dlaczego, 
>> bo mam:
>>
>> robert@lenovo:~/Projekty/dirtyphp-website/app/Config$ ls -la 
>> *constants.php
>> -rw-rw---- 1 robert www-data 1574 sie 15  2021 errmsg_constants.php
>> -rw-rw---- 1 robert www-data  944 lis  5 06:16 hosting_constants.php
>> -rw-rw---- 1 robert www-data 1803 sie 15  2021 localhost_constants.php
>> -rw-rw---- 1 robert www-data 1086 maj  2 21:52 other_constants.php
>> -rw-rw---- 1 robert www-data 1031 sie 15  2021 webdep_constants.php
>>
>> tzn. uprawnienia są takie same dla wszystkich plików.
> 
> ustaw error_reporting i display_errors w php.ini tak aby wyświetlało ci 
> (wszystkie) błędy na tym środowisku testowycm.
> 

Dzięki, pomogłeś, miałem błąd wykonania w webdep_constants.php - problem 
zamknięty.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads