Php on line 139

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Uncaught TypeError: feof(): supplied resource is not a valid stream resource #150

PHP Fatal error: Uncaught TypeError: feof(): supplied resource is not a valid stream resource #150

Comments

Hi!
Whenever I run my script with the pools that were working perfectly fine 2 days ago, now I get this at random points of the running process:

PHP Fatal error: Uncaught TypeError: feof(): supplied resource is not a valid stream resource in /var/www/mydomain.com/api/vendor/symfony/process/Pipes/UnixPipes.php:139 Stack trace: #0 /var/www/mydomain.com/api/vendor/symfony/process/Pipes/UnixPipes.php(139): feof() #1 /var/www/mydomain.com/api/vendor/symfony/process/Process.php(1434): Symfony\Component\Process\Pipes\UnixPipes->readAndWrite() #2 /var/www/mydomain.com/api/vendor/symfony/process/Process.php(1357): Symfony\Component\Process\Process->readPipes() #3 /var/www/mydomain.com/api/vendor/symfony/process/Process.php(862): Symfony\Component\Process\Process->updateStatus() #4 /var/www/mydomain.com/api/vendor/symfony/process/Process.php(921): Symfony\Component\Process\Process->isRunning() #5 /var/www/mydomain.com/api/vendor/symfony/process/Process.php(213): Symfony\Component\Process\Process->stop() #6 [internal function]: Symfony\Component\Process\Process->__destruct() #7 thrown in /var/www/mydomain.com/api/vendor/symfony/process/Pipes/UnixPipes.php on line 139 Fatal error: Uncaught TypeError: feof(): supplied resource is not a valid stream resource in /var/www/mydomain.com/api/vendor/symfony/process/Pipes/UnixPipes.php:139 Stack trace: #0 /var/www/mydomain.com/api/vendor/symfony/process/Pipes/UnixPipes.php(139): feof() #1 /var/www/mydomain.com/api/vendor/symfony/process/Process.php(1434): Symfony\Component\Process\Pipes\UnixPipes->readAndWrite() #2 /var/www/mydomain.com/api/vendor/symfony/process/Process.php(1357): Symfony\Component\Process\Process->readPipes() #3 /var/www/mydomain.com/api/vendor/symfony/process/Process.php(862): Symfony\Component\Process\Process->updateStatus() #4 /var/www/mydomain.com/api/vendor/symfony/process/Process.php(921): Symfony\Component\Process\Process->isRunning() #5 /var/www/mydomain.com/api/vendor/symfony/process/Process.php(213): Symfony\Component\Process\Process->stop() #6 [internal function]: Symfony\Component\Process\Process->__destruct() #7 thrown in /var/www/mydomain.com/api/vendor/symfony/process/Pipes/UnixPipes.php on line 139 

The text was updated successfully, but these errors were encountered:

Читайте также:  Dive into python 3 mark pilgrim

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error : preg_replace_callback(): Requires argument 2 #167

error : preg_replace_callback(): Requires argument 2 #167

Comments

i am getting following error message in error.log file.

using MySQL database, refer attached api output.

PHP Warning: preg_replace_callback(): Requires argument 2, », to be a valid callback in /home/uponcje1/public_html/crud/api.php on line 139

image

The text was updated successfully, but these errors were encountered:

Thanks for your prompt reply.

refer following details and screenshot.

this is the file/code I have downloaded yesterday so I don’t have any other version. If you have latest api code kind forward the same.

image

image

as you advice i have commented line number 2 , after doing this i am getting out as per screen shot 2.

image

image

And do you have a table named «employeemast»? It seems that the database is still empty, is that true?

yes, table name is correct, but it has some records, refer below screen shot

image

You probably have defined a ‘table_authorizer’, because I can’t see those tables in the swagger output. Can you post the definition of the ‘table_authorizer’ function?

i not expert in PHP, can you be more specific, where and what code i should write.

as i would be performing get , post & put functions.

pls. help me i need your support very badly.

I think you may have not entered the configuration right in the bottom of the «api.php» file. Can you check that you have the «database» (uponcje1_eappsupon), «username» and «password» fields set to the right MySQL login values? Typically those would be the ones you use to login to PHPMyAdmin, but I see that you use cPanel, so it may differ.

Refer below credential updated, by using same credential i am able to get data using some other php file.
can you advice how to check whether i am connected to DB or not.

image

Maybe you are not allowed to do ‘information_schema’ queries (the SQL reflection technology that makes the PHP-CRUD-API work). Can you try to execute the following SQL from PHPMyAdmin?

SELECT `TABLE_NAME`,`TABLE_COMMENT` FROM `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA` = 'uponcje1_eappsupon'; 

refer below output and user privileges.

image

image

after line 140 and post the output at:

I think your SQL queries are somehow failing. Let’s try to run them manually.

Additional questions: What version is your database? Is the «mysqli» (note the ‘i’) extension enabled?

no it is MySql only. if you want you can connect my laptop using remote software like ***

image

refer below output after adding echo «\n$sql\n»; at line 140

image

It seems you run percona mysql 5.5.44, let me check whether or not I can make it work on that version. Please hold on..

thx for your great support and prompt action, i would be very thankful, if you can make it.

It is hard to reproduce your problem. I installed Ubuntu 12.04 with percona 5.5.53 and it works. There are some issues:

But nothing critical. Are you sure the credentials work properly and these are for the right database? Do you have an error log in cpanel where something can be seen?

No error log entries? Can you install Adminer and try the information schema query using the credentials you use for service.php? See https://Adminer.org it is a single file phpmyadmin alternative.

On Tue, Jan 24, 2017 at 1:32 PM, Maurits van der Schee < ***@***.***>wrote: No error log entries? Can you install Adminer and try the information schema query using the credentials you use for service.php? See https://Adminer.org it is a single file phpmyadmin alternative. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .

I think there is, you said earlier:

i am getting following error message in error.log file.

Can you post the full contents of the error.log file (or mail it to me?)

It seems the function has no syntax error: https://3v4l.org/1LPX5

refer below screen shot, i am able to connect with same credential using adminer-4.2.5-mysql tool.

also refer attached log file

image

image

Can you try the following query (again) in adminer?

SELECT `TABLE_NAME`,`TABLE_COMMENT` FROM `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA` = 'uponcje1_eappsupon'; 

Are you sure the api.php file is uploaded properly? Can you use another method of putting the file on the server (without editing it in the web editor maybe)? It indeed still seems like the anonymous function is not properly interpreted as it still says:

preg_replace_callback(): Requires argument 2, '', to be a valid callback 

Thank you for your patience

Refer below output.
Secondly, extracted API file from Zip file and copier on c:/ drive, and edited using note pad. and then uploaded. but same error msg. Not found (entity)

but when change format to JSON Getting error msg. Unexpected ‘N’

[24-Jan-2017 19:59:07 Etc/GMT] PHP Warning: preg_replace_callback(): Requires argument 2, », to be a valid callback in /home/uponcje1/public_html/crud/api.php on line 139

image

image

image

Okay, everything still looks as expected.

Can you try the following code to see whether or not all anonymous functions are broken?

, $string ); echo $newstring; //prints "Some numbers: one: 11; two: 12; three: 13 end"; 

This issue is getting weirder and weirder. a challenge 😉

refer below out put, hope this is correct way to execute code.

image

image

image

okay.. it seems anonymous functions are not working at all on your setup..

What is the last line in the error log?

Can you replace ‘&$ten’ with ‘$ten’ in the test.php file and run again, like this?

, $string ); echo $newstring; //prints "Some numbers: one: 11; two: 12; three: 13 end"; 
, $string ); echo $newstring; //prints "Some numbers: one: 1; two: 2; three: 3 end"; 

after replacing ‘&$ten’ with ‘$ten’ and refer output of error.log file

image

output of send file test2.php

image

24-Jan-2017 20:26:04 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 534507081 bytes) in /home/uponcje1/public_html/crud/test.php on line 8
[24-Jan-2017 20:26:15 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 534737593 bytes) in /home/uponcje1/public_html/crud/test.php on line 8
[24-Jan-2017 20:26:43 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 534743889 bytes) in /home/uponcje1/public_html/crud/test.php on line 8
[24-Jan-2017 20:27:27 Etc/GMT] PHP Parse error: syntax error, unexpected ‘»Some numbers: one: 11; two: 1’ (T_CONSTANT_ENCAPSED_STRING) in /home/uponcje1/public_html/crud/test.php on line 10
[24-Jan-2017 20:27:38 Etc/GMT] PHP Parse error: syntax error, unexpected ‘»Some numbers: one: 11; two: 1’ (T_CONSTANT_ENCAPSED_STRING) in /home/uponcje1/public_html/crud/test.php on line 10
[24-Jan-2017 20:28:04 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 534743889 bytes) in /home/uponcje1/public_html/crud/test.php on line 8
[24-Jan-2017 20:28:44 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 534754969 bytes) in /home/uponcje1/public_html/crud/test.php on line 8
[24-Jan-2017 20:29:33 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 534744385 bytes) in /home/uponcje1/public_html/crud/test.php on line 8
[24-Jan-2017 20:29:49 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 534733081 bytes) in /home/uponcje1/public_html/crud/test.php on line 8
[24-Jan-2017 20:38:04 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 515169865 bytes) in /home/uponcje1/public_html/crud/test.php on line 8
[24-Jan-2017 20:41:02 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4199308489 bytes) in /home/uponcje1/public_html/crud/test2.php on line 7
[24-Jan-2017 20:41:07 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4199304705 bytes) in /home/uponcje1/public_html/crud/test.php on line 8
[24-Jan-2017 20:41:19 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4199301457 bytes) in /home/uponcje1/public_html/crud/test2.php on line 7
[24-Jan-2017 20:41:34 Etc/GMT] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4199541929 bytes) in /home/uponcje1/public_html/crud/test2.php on line 7

Источник

Оцените статью