I try to load PHP from console (in windows) and when I run phpinfo.php the line
Loaded Configuration File => (none)
but when I run this pagin in web browser I see it:
Loaded Configuration File C:\MAMP\conf\php5.6.28\php.ini
My problem appear when I try to install symfony
Warning: readfile(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1
Warning: readfile(https://symfony.com/installer): failed to open stream: Invalid argument in Command line code on line 1
I can't able to download this file from console, can anyone help me please?
Related
I get a strange php error:
2022-03-14 10:52:19: (mod_fastcgi.c.421) FastCGI-stderr: PHP message:
PHP Warning: Unknown: failed to open stream:
No such file or directory in Unknown on line 0
PHP message: PHP Fatal error: Unknown: Failed opening required
'var/www/vhosts/webdev/sites/test/hello.php'
(include_path='.') in Unknown on line 0
Long explanation:
I create a file hello.php in my webroot, having the content:
<?php echo("hello"); ?>
I run this file in a browser, all is fine, it shows "hello"
Now I edit this file so the content now is:
<?php echo("hello"); echo("world"); ?>
I run this edited file in a browser => The error is shown
I reload the page (F5 or ctrl-R) => all is working fine now
In other words:
Whenever I edit a php file and try to run it in a browser, I get this error message. After reloading the page it works!
That is the real strange thing, after reloading everything is working fine!!!
My config
a local raspberry pi running raspbian
webserver: lighttpd (standard install from repo)
php7.3-fpm (standard install from repo)
all file permissions in my web dev folder are 775, all files are www-data:www-data owned
NO selinux running (like in other answers suggested)
the php.ini is pretty much untouched, some options:
auto_prepend_file =
auto_append_file =
include_path = "."
there are no other hidden config files in the folder
With html files there are no problems. So it must be a php-fpm problem.
I am out of ideas now. It might be a very easy fix, but I am not a Pro.
Any ideas how to fix this?
In the error log, the path doesn't start with a slash "/"
var/www/vhosts/webdev/sites/test/hello.php
which indicates a misconfiguration in lighttpd/fastcgi configuration
Fixing the path should make everything work correctly.
I'm trying to load an extension on my PHP site:
$db->loadExtension('libdbplusql_81203.so');
PHP.ini:
sqlite3.extension_dir = /usr/lib/php/20180731
Error-Log from Apache2:
PHP Warning: SQLite3::loadExtension(): /usr/lib/php/20180731/libdbplusql_81203.so.so: cannot open shared object file: No such file or directory in /var/www/pdb/index.php on line 76
Can't figure out why this is not working.... and it's weird, that in the error log it says ".so.so" - when I change my code to:
$db->loadExtension('libdbplusql_81203');
Error Log say:
PHP Warning: SQLite3::loadExtension(): Unable to load extension at '/usr/lib/php/20180731/libdbplusql_81203' in /var/www/pdb/index.php on line 76
Maybe you have an idea :-)
I am trying to get phpdoc working on netbeans but I am getting the following error
PHP Warning: require(PhpDocumentor/phpDocumentor/phpdoc.inc): failed to open stream: No such file or directory in /Applications/MAMP/bin/php/php5.4.4/bin/phpdoc on line 40
PHP Fatal error: require(): Failed opening required 'PhpDocumentor/phpDocumentor/phpdoc.inc' (include_path='.:') in /Applications/MAMP/bin/php/php5.4.4/bin/phpdoc on line 40
When I run
pear config-show in the Terminal I get the following php_dir path
/Applications/MAMP/bin/php/php5.4.4/lib/php
I have checked that the php.ini file exits and it does under
/Applications/MAMP/bin/php/php5.4.4/lib/php/phpDocumentor/phpDocumentor/phpdoc.ini
Does anyone know what the problem can be or how to resolve it. I want to use the phpdoc using Netbeans and not have to revert to the Terminal every time I want to update my documentation.
You need to edit include_path in php.ini to add PEAR's php_dir value to it. Notice in the error message that your include_path is set to nothing but ".". As such, the only place PHP is looking for PhpDocumentor/phpDocumentor/phpdoc.inc is right there in your /Applications/MAMP/bin/php/php5.4.4/bin directory. Once you add /Applications/MAMP/bin/php/php5.4.4/lib/php to your include_path, then PHP will be able to find the phpdoc.inc file at runtime.
I've been trying to use a few PEAR packages for a few hours now to no avail. PEAR itself is functioning, and I believe I set all of the configuration variables correctly, but when I try to run any of my packages from the command line, I get PHP errors telling me the required file wasn't found. For example, with phpdoc:
$ phpdoc
PHP Warning: require(PhpDocumentor/phpDocumentor/phpdoc.inc): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40
Warning: require(PhpDocumentor/phpDocumentor/phpdoc.inc): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40
PHP Fatal error: require(): Failed opening required 'PhpDocumentor/phpDocumentor/phpdoc.inc' (include_path='.:/Applications/MAMP/bin/php5.2/lib/php') in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40
Fatal error: require(): Failed opening required 'PhpDocumentor/phpDocumentor/phpdoc.inc' (include_path='.:/Applications/MAMP/bin/php5.2/lib/php') in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40
I tried manually editing the files, inserting the absolute path to the files, but when I correct one require error a new one just comes up.
This is my pear.conf:
#PEAR_Config 0.9
a:15:{s:10:"__channels";a:2:{s:12:"pecl.php.net";a:0:{}s:5:"__uri";a:0:{}}s:15:"preferred_state";s:6:"stable";s:8:"temp_dir";s:35:"/Applications/MAMP/htdocs/pear/temp";s:7:"bin_dir";s:34:"/Applications/MAMP/htdocs/pear/bin";s:7:"php_dir";s:35:"/Applications/MAMP/htdocs/pear/PEAR";s:7:"doc_dir";s:40:"/Applications/MAMP/htdocs/pear/PEAR/docs";s:8:"data_dir";s:40:"/Applications/MAMP/htdocs/pear/PEAR/data";s:8:"test_dir";s:41:"/Applications/MAMP/htdocs/pear/PEAR/tests";s:9:"cache_dir";s:41:"/Applications/MAMP/htdocs/pear/PEAR/cache";s:9:"cache_ttl";i:300;s:12:"download_dir";s:44:"/Applications/MAMP/htdocs/pear/temp/download";s:10:"http_proxy";s:0:"";s:7:"ext_dir";s:74:"/Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20050922";s:7:"php_bin";s:37:"/Applications/MAMP/bin/php5.2/bin/php";s:10:"sig_keydir";s:39:"/Applications/MAMP/conf/php5.2/pearkeys";}
I'm using MAMP PRO v1.9.5 on Mac OS 10.7.5 with PHP v5.2.17. Also, I installed the packages with the PEAR web interface package manager. If any further information is required, please let me know and I'll post it.
Make sure that the include path contains the folder where PEAR installs php class files. Check your include_path ini setting. It should look like:
include_path=".:PEAR_CLASSES_PATH"
where PEAR_CLASSES_PATH is the pear class path
I just leased a dedicated windows server with Plesk 10.4 installed. I assumed that php, etc would all be configured and that I could prot my sites over with no isses...
Turns out the default image didn't have pear installed...I believe i need pear so include statements work in php...so I used go-pear.bat to install it...
However, I'm still getting an error when including (you can follow the path to see the file exists)
Warning: include(Connections/SamConnection.php) [function.include]: failed to open stream: Operation not permitted in C:\Inetpub\vhosts\80stunes.com\httpdocs\index.php on line 3
Warning: include() [function.include]: Failed opening 'Connections/SamConnection.php' for inclusion (include_path='.;C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\PEAR;C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5;./includes;./pear') in C:\Inetpub\vhosts\80stunes.com\httpdocs\index.php on line 3
Any ideas on what I have done wrong? I can run pear commands from a command prompt when accessing my pleskphp5 directory
Sounds like you may have open_basedir enabled.