OpenShift apache modules - apache

How do you find out on OpenShift which apache modules are loaded?
I tried following the instructions here, and can see the compiled in modules by running /usr/sbin/httpd -l. However if I try to run /usr/sbin/httpd -M, or an equivalent command, I get an error: "Could not open configuration file /etc/httpd/conf/httpd.conf: Permission denied". I also get a permission denied error if I try to open the config file in read only with a text editor, via nano -v /etc/httpd/conf/httpd.conf.
I'm using the Python 3.3 cartridge. I can't find any way of finding the apache modules directly from python (the list of loaded modules doesn't seem to be passed via the environ argument to the WSGI app object).
Also, trying via php doesn't help. php -r "phpinfo();" doesn't give the info - I've grepped in the output for 'apache' and 'mod_', and looked with the naked eye, and there's no sign of any apache module data. Trying apache_get_modules also didn't work, the function is undefined.
I was particularly wondering if the mod_setenvif module was available (the SetEnvIf command doesn't seem to be working for me..)

You can view the currently loaded apache modules by looking at the following file on your gear: /php/usr/shared/etc/conf/httpd.conf

Related

Laravel failed to listen on 127.0.0.1:8000 (reason ?)

So I just created a new project using the command:
laravel new blog
Then I started by changing the directory and do the command
php artisan serve
And this is what happened, more details:
I'm using laravel 8.0.1 (latest version)
I haven't run any command except the one I listed above
I'm using windows
I even updated the php to 7.4.10 (latest ver)
I came across the same issue.
This was how how I solved mine:
Goto the main PHP part, I mean the installed PHP from official website.
Look out for a folder named php.ini-development
Duplicate this file.
Then rename the copy to php.ini
Go back to your laravel project folder and rerun php artisan serve
PS: If there is any additional steps you took, you can as well comment them below:
XOXO
So actually i dont actually know what the reason is, but using the php -S localhost:8000 -t public
Check your PHP version in your local server and System variable path. Make sure they are using the same PHP version
I had this problem too, and I solved it in this way:
set: php.ini
variables_order = "GPCS"
This error is because the php.ini was not found.
run php --ini
Configuration File (php.ini) Path:
Loaded Configuration File: C:\php8\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
The line "Loaded Configuration File" would indicate the location of loaded php.ini, if not, rename the php.ini-development to php.ini

Installing Google Adwords Api Library (using docker)

Googles documentation on installing the library, found here: https://github.com/googleads/googleads-php-lib/blob/master/README.md#getting-started, instructs us to copy adsapi_php.ini, as constructed here: https://github.com/googleads/googleads-php-lib/blob/master/examples/AdWords/adsapi_php.ini, to your home directory.
I filled out the necessary variables in the .ini, and I am using docker so I have placed this file inside my container at /var/www/home/node/ and when I run the command composer require googleads/googleads-php-lib I am given the following error in the command prompt:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for googleads/googleads-php-lib ^37.1 -> satisfiable by googleads/googleads-php-lib[37.1.0].
- googleads/googleads-php-lib 37.1.0 requires ext-soap * -> the requested PHP extension soap is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/php.ini
- /usr/local/etc/php/conf.d/adsapi_php.ini
- /usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini
- /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
- /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
I assumed the issue was my adsapi_php.ini was simply in the wrong location as it contains what I believe is necessary to avoid the above issue, but I have tried placing it in several different places and yet I always get the same error.
Any help would be appreciated!
Just try to edit php.ini inside docker (docker exec -t {container} bashand enable there the extenstion soap

Unable to activate Curl on Easyphp Devserver 16.1.1

I am trying to activate curl on my Easyphp Devserver 16.1.1, but I keep getting the error:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php5619vc11x86x160615094909\ext\php_curl.dll' - Impossibile trovare il modulo specificato [cannot open shared object file: No such file or directory].\r\n in Unknown on line 0
I did the following:
un-commented "extension=php_curl.dll" in both php.ini files
verified that the file php_curl.dll actually exists in extension_dir
copied libeay32.dll, libsasl.dll, ssleay32.dll to c:\Windows\System\, c:\Windows\System32\, c:\Windows\SysWOW64\
Downloaded cacert.pem from http://curl.haxx.se/ca/cacert.pem and added the full path to it on curl.cainfo in php.ini
Downloading various versions of curl from https://curl.haxx.se
Set paths to php directories in My Computer > Properties > Advanced > Environment Variables (eg: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php5619vc11x86x160615094909\)
I rebooted after doing all these steps (specially for the step #6)
There are at least 5 similar questions, I followed every suggestion but nothing worked. Apache continues not to see my dll. Can anybody help on this issue?
Old topic but for people who land here and want skip all of the useless steps of Lucian.
Just use the answer from Anar Haziyev on this link:
Activation Curl on EasyPHP
work on easyphp devserver.
I faced the same issue with EasyPHP and what it fixed is that I had to install PHP as a different instance, not in the EasyPHP build and started the PHP service from the command line.

Serving lua pages in apache windows

I have been using php for CGI scripting for some time now and recently got interested in lua.
I installed the latest version of luarocks(2.1.2) and the bundled version of lua(5.1.4). I wanted to start from the basics and hence installed cgilua(5.1.4-2) and all its dependencies using "luarocks install cgilua".
I am able to run simple lua scripts using the shebang line to point to my lua interpreter but when i use it to point to the cgi launcher "cgilua.cgi.exe" to run .lp files it just won't work. I edited my httpd configuration file to allow cgi execution in my htdocs and cgi-bin directory and used the cgi-script handler for .lp pages. I am trying to run the login.lp example in the cgilua examples directory. I even added the line "Content-type:text/html" to no avail. Executing the cgilua.cgi.exe file from the command line without arguments just closes the application with the message "cgilua.cgi.exe" stopped working".
Could anyone tell me what am I missing? Maybe the launcher is supposed to be used in a different way?
I don't suppose permissions have a part to play in this as in windows all users have at least read and execute permissions.
The url I'm trying to access is http://localhost/login.lp. My apache error log shows "Premature end of script headers: login.lp" with a 500 internal server error and the same thing if I access http://localhost/cgilua.cgi.exe
I don't know what your requirements are, but perhaps it will be easier to simply use apache's mod_lua.
http://httpd.apache.org/docs/trunk/mod/mod_lua.html

Configuration Issues with PECL and PHP-FPM

I'm using Ubuntu Natty. I recently installed NGINX 1.0.6 and PHP 5.3.8 (with --enable-fpm) from source. Everything went ok and I tested it with an info.php page with phpinfo().
I then installed APC and Memcache using PECL i.e. pecl install apc, etc. That seemed to go ok as well.
However, when I edit my php.ini file and add the extension_dir and extension modules for both APC and Memcache, I get the following when I restart PHP.
Starting php-fpm PHP Warning: Module 'apc' already loaded in Unknown on line 0
<br />
<b>Warning</b>: Module 'apc' already loaded in <b>Unknown</b> on line <b>0</b><br />
PHP Warning: Module 'memcache' already loaded in Unknown on line 0
<br />
<b>Warning</b>: Module 'memcache' already loaded in <b>Unknown</b> on line <b>0</b><br />
done
When I open the info.php file to check what loaded, everything seems ok i.e. I see APC and Memcache references in the information.
But when I uncomment the extensions i.e. ;extension=apc.so and ;extension=memcache.so, there are no errors, but the APC and Memcache listings in PHPinfo no longer appear.
I'm not sure how these extensions are being loaded twice and from where. I'd appreciate some guidance.
Thanks in advance.
EDIT
I'm using PHP-FPM and using lsof -i -P it appears that I have multiple pools of PHP-FPM running. Could this be part of the problem why I am seeing this error?! Is there a way to fix this?!
When you run: php --ini, do you get this:
Configuration File (php.ini) Path: /etc/php5
Loaded Configuration File: /etc/php5/php.ini
Scan for additional .ini files in: /etc/php5
Additional .ini files parsed: /etc/php5/php.ini
If yes, you should re-run your configure script so not to specify the additional ini file directory.