Why PHP Sessions Memcached works but Memcache doesn't? - php

I'm trying to figure out what's wrong for hours,
<?php
ini_set("session.save_handler","memcached");
ini_set("session.save_path","127.0.0.1:11211");
session_start();
print "Session started..\n<br />\n";
?>
Will print but if it's "memcache" notice the "d" it will not work + fire the error in php-fpm
php -i | grep memcach
memcache
memcache support => enabled
memcache.allow_failover => 1 => 1
memcache.chunk_size => 32768 => 32768
memcache.compress_threshold => 20000 => 20000
memcache.default_port => 11211 => 11211
memcache.hash_function => crc32 => crc32
memcache.hash_strategy => consistent => consistent
memcache.lock_timeout => 15 => 15
memcache.max_failover_attempts => 20 => 20
memcache.protocol => ascii => ascii
memcache.redundancy => 1 => 1
memcache.session_redundancy => 2 => 2
Registered save handlers => files user memcache redis
php.ini set as following:
session.save_path = "/var/lib/php/session"
session.save_handler = files
error in php-fpm
PHP Fatal error: session_start(): Failed to initialize storage module: memcache (path: /var/lib/php/session) in /home/webs/pricegoto.com/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 125

Try some thing like this :
ini_set('session.save_handler', 'memcache');
ini_set('session.save_path',
'tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15');

Related

Can't enable Zend OpCache on AlmaLinux and PHP8

I'm using AlmaLinux 8.4, and I'm trying to install Zend Opcache and verify that it's running.
In Easy Apache, php8 and php80-php-opcache are installed. php -1 shows Zend is not enabled, while php -a does, and 10-opcache.ini is loaded. (I see that CLI is not enabled, but I don't need it.)
Apache and PHP-FPM have been restarted several times.
Is this configuration correct?
How do I determine if Zend Opcode is actually running?
[root}# php -i shows:
Zend OPcache
Opcode Caching => Disabled
Optimization => Disabled
SHM Cache => Enabled
File Cache => Disabled
JIT => On
Startup Failed => Opcode Caching is disabled for CLI
Loaded Configuration File => /opt/cpanel/ea-php80/root/etc/php.ini
Additional .ini files parsed => /opt/cpanel/ea-php80/root/etc/php.d/10-opcache.ini
Core
PHP Version => 8.0.9
zend.assertions => -1 => -1
zend.detect_unicode => On => On
zend.enable_gc => On => On
zend.exception_ignore_args => Off => Off
zend.exception_string_param_max_len => 15 => 15
zend.multibyte => Off => Off
zend.script_encoding => no value => no value
zend.signal_check => Off => Off
The file /opt/cpanel/ea-php80/root/etc/php.d/10-opcache.ini shows
Enable Zend OPcache extension module
zend_extension=opcache.so
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0
; The OPcache shared memory storage size.
opcache.memory_consumption=128
; The amount of memory for interned strings in Mbytes.
opcache.interned_strings_buffer=8
; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
opcache.max_accelerated_files=4000
php -a shows
php > print_r(opcache_get_configuration());
Array
(
[directives] => Array
(
[opcache.enable] => 1
[opcache.enable_cli] =>
[opcache.use_cwd] => 1
[opcache.validate_timestamps] => 1
[opcache.validate_permission] => 1
[opcache.validate_root] =>
[opcache.dups_fix] =>
[opcache.revalidate_path] =>
[opcache.log_verbosity_level] => 1
[opcache.memory_consumption] => 134217728
[opcache.interned_strings_buffer] => 8
[opcache.max_accelerated_files] => 4000
[opcache.max_wasted_percentage] => 0.05
[opcache.consistency_checks] => 0
[opcache.force_restart_timeout] => 180
[opcache.revalidate_freq] => 2
[opcache.preferred_memory_model] =>
[opcache.blacklist_filename] => /opt/cpanel/ea-php80/root/etc/php.d/opcache*.blacklist
[opcache.max_file_size] => 0
[opcache.error_log] =>
[opcache.protect_memory] =>
[opcache.save_comments] => 1
[opcache.record_warnings] =>
[opcache.enable_file_override] =>
[opcache.optimization_level] => 2147401727
[opcache.lockfile_path] => /tmp
[opcache.file_cache] =>
[opcache.file_cache_only] =>
[opcache.file_cache_consistency_checks] => 1
[opcache.file_update_protection] => 2
[opcache.opt_debug_level] => 0
[opcache.restrict_api] =>
[opcache.huge_code_pages] =>
[opcache.preload] =>
[opcache.preload_user] =>
[opcache.jit] => tracing
[opcache.jit_buffer_size] => 0
[opcache.jit_debug] => 0
[opcache.jit_bisect_limit] => 0
[opcache.jit_blacklist_root_trace] => 16
[opcache.jit_blacklist_side_trace] => 8
[opcache.jit_hot_func] => 127
[opcache.jit_hot_loop] => 64
[opcache.jit_hot_return] => 8
[opcache.jit_hot_side_exit] => 8
[opcache.jit_max_exit_counters] => 8192
[opcache.jit_max_loop_unrolls] => 8
[opcache.jit_max_polymorphic_calls] => 2
[opcache.jit_max_recursive_calls] => 2
[opcache.jit_max_recursive_returns] => 2
[opcache.jit_max_root_traces] => 1024
[opcache.jit_max_side_traces] => 128
[opcache.jit_prof_threshold] => 0
)
[version] => Array
(
[version] => 8.0.9
[opcache_product_name] => Zend OPcache
)
[blacklist] => Array
(
)
)
To determine if the opcache is enabled and working and ensure that the JIT actually works, create a PHP script that's accessible via the browser and look at the output of opcache_get_status().
Example PHP file can be:
var_dump(opcache_get_status());
Example output when it is enabled is:
array(9) {
["opcache_enabled"]=>
bool(true)
...
if the opcache extension is not installed or not enabled it will throw this error:
Fatal error: Uncaught Error: Call to undefined function opcache_get_status()
Another option is that you print out your phpinfo and check for opcache in the output:
<?php phpinfo(); ?>

PDOException::("could not find driver") on Laravel migration. PHP version is 7.3.7. Extension is uncommented in php.ini. Not sure what else to do

Here are a few facts:
I'm using MySQL and can insert, update, delete and select from the database just fine, however, when I try to migrate, I get this error -
Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = lol and table_name = migrations and table_type = 'BASE TABLE')
When I phpinfo();, it says that my project uses PHP 7.3.7 and my php.ini file is located in C:\MAMP\conf\php7.3.7\php.ini
When I type php --ini in the command line I get Loaded Configuration File: C:\MAMP\bin\php\php7.3.7\php.ini
These 3 lines in the php.ini file are uncommented
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
In database.php laravel file MySQL is set as default:
'default' => env('DB_CONNECTION', 'mysql'),
Migrations worked last time I used them but now I'm getting this error. Any ideas on how to fix it?
get_loaded_extensions() returns this:
array:45 [▼
0 => "Core"
1 => "bcmath"
2 => "calendar"
3 => "com_dotnet"
4 => "ctype"
5 => "date"
6 => "filter"
7 => "hash"
8 => "iconv"
9 => "json"
10 => "SPL"
11 => "odbc"
12 => "pcre"
13 => "Reflection"
14 => "session"
15 => "sockets"
16 => "standard"
17 => "mysqlnd"
18 => "tokenizer"
19 => "zip"
20 => "zlib"
21 => "libxml"
22 => "dom"
23 => "PDO"
24 => "bz2"
25 => "SimpleXML"
26 => "soap"
27 => "xml"
28 => "wddx"
29 => "xmlreader"
30 => "xmlwriter"
31 => "apache2handler"
32 => "mysqli"
33 => "openssl"
34 => "gd"
35 => "gettext"
36 => "mbstring"
37 => "exif"
38 => "pdo_sqlite"
39 => "sqlite3"
40 => "curl"
41 => "Phar"
42 => "imagick"
43 => "pdo_mysql"
44 => "fileinfo"
]

PHP 7.1.14 APCu not working in Mac OSX High Sierra

I am not able to make apc work with High Sierra and PHP 7.1.14. I have done everything.
Below is the output for php -i | grep apc
PHP Warning: Method apc_store() cannot be a NULL function in Unknown
on line 0
PHP Warning: apc: Unable to register functions, unable to load in
Unknown on line 0
Warning: Method apc_store() cannot be a NULL function in Unknown on
line 0
Warning: apc: Unable to register functions, unable to load in Unknown
on line 0
apcu
apc.coredump_unmap => Off => Off
apc.enable_cli => On => On
apc.enabled => On => On
apc.entries_hint => 4096 => 4096
apc.gc_ttl => 3600 => 3600
apc.mmap_file_mask => no value => no value
apc.preload_path => no value => no value
apc.serializer => php => php
apc.shm_segments => 1 => 1
apc.shm_size => 64M => 64M
apc.slam_defense => On => On
apc.smart => 0 => 0
apc.ttl => 7200 => 7200
apc.use_request_time => On => On
apc.writable => /tmp => /tmp
And output of phpinfo() also shows apcu is enabled.
But when I run my application, below error gets printed:
[Fri May 25 18:43:30.523133 2018] [php7:error] [pid 1693] [client
10.146.5.127:54542] PHP Fatal error: Uncaught Error: Call to undefined
function apc_store()
This is the code snippet which adds data into the apc_store:
public static function add(LoggedInUser $loggedInUser) {
if (!is_null($loggedInUser) && !is_null($loggedInUser->getUserData()) &&
!is_null($loggedInUser->getUserData()->userId)) {
apc_store($loggedInUser->getUserData()->userId, $loggedInUser, 60);
}
}

Php artisan return few blank lines after attempting to integrate Laravel with postgreSQL

At first I wanted to use PostgreSQL as the database for my Laravel project. I have tried to changed everything as people posted online such as:
1. changing 'default' => env('DB_CONNECTION', 'mysql') to 'default' => env('DB_CONNECTION', 'pgsql')
2. Setup my .env file to follow the postgresql configuration
I have already installed postgresql as it returns psql (10.1, server 9.5.10) as I type pgsql in my terminal
However, whenever I tried to php artisan migrate it will shows some errors (I forget to capture the error). After few hours of surfing I found this tutorial that seemed promising. I followed everything and it took a little while. When it finished, I tried to type php artisan migrate in terminal and what returned was
hznk:fraudet hznk$ php artisan migrate
hznk:fraudet hznk$
here is the php info:
PHP Version => 7.0.15
System => Darwin hznk.local 17.3.0 Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64
Build Date => Dec 29 2017 18:33:15
Configure Command => './configure' '--without-iconv'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => (none)
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20151012
PHP Extension => 20151012
Zend Extension => 320151012
Zend Extension Build => API320151012,NTS
PHP Extension Build => API20151012,NTS
Debug Build => no
Thread Safety => disabled
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => disabled
IPv6 Support => enabled
DTrace Support => disabled
Registered PHP Streams => php, file, glob, data, http, ftp, phar
Registered Stream Socket Transports => tcp, udp, unix, udg
Registered Stream Filters => string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk
This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
_______________________________________________________________________
Configuration
Core
PHP Version => 7.0.15
Directive => Local Value => Master Value
allow_url_fopen => On => On
allow_url_include => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
auto_append_file => no value => no value
auto_globals_jit => On => On
auto_prepend_file => no value => no value
browscap => no value => no value
default_charset => UTF-8 => UTF-8
default_mimetype => text/html => text/html
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => STDOUT => STDOUT
display_startup_errors => Off => Off
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => On => On
enable_post_data_reading => On => On
error_append_string => no value => no value
error_log => no value => no value
error_prepend_string => no value => no value
error_reporting => no value => no value
exit_on_timeout => Off => Off
expose_php => On => On
extension_dir => /usr/local/lib/php/extensions/no-debug-non-zts-20151012 => /usr/local/lib/php/extensions/no-debug-non-zts-20151012
file_uploads => On => On
highlight.comment => <font style="color: #FF8000">#FF8000</font> => <font style="color: #FF8000">#FF8000</font>
highlight.default => <font style="color: #0000BB">#0000BB</font> => <font style="color: #0000BB">#0000BB</font>
highlight.html => <font style="color: #000000">#000000</font> => <font style="color: #000000">#000000</font>
highlight.keyword => <font style="color: #007700">#007700</font> => <font style="color: #007700">#007700</font>
highlight.string => <font style="color: #DD0000">#DD0000</font> => <font style="color: #DD0000">#DD0000</font>
html_errors => Off => Off
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => On
include_path => .:/usr/local/lib/php => .:/usr/local/lib/php
input_encoding => no value => no value
internal_encoding => no value => no value
log_errors => Off => Off
log_errors_max_len => 1024 => 1024
mail.add_x_header => Off => Off
mail.force_extra_parameters => no value => no value
mail.log => no value => no value
max_execution_time => 0 => 0
max_file_uploads => 20 => 20
max_input_nesting_level => 64 => 64
max_input_time => -1 => -1
max_input_vars => 1000 => 1000
memory_limit => 128M => 128M
open_basedir => no value => no value
output_buffering => 0 => 0
output_encoding => no value => no value
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 14 => 14
realpath_cache_size => 16K => 16K
realpath_cache_ttl => 120 => 120
register_argc_argv => On => On
report_memleaks => On => On
report_zend_debug => Off => Off
request_order => no value => no value
sendmail_from => no value => no value
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
serialize_precision => 17 => 17
short_open_tag => On => On
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
sys_temp_dir => no value => no value
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => no value => no value
user_dir => no value => no value
user_ini.cache_ttl => 300 => 300
user_ini.filename => .user.ini => .user.ini
variables_order => EGPCS => EGPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
zend.assertions => 1 => 1
zend.detect_unicode => On => On
zend.enable_gc => On => On
zend.multibyte => Off => Off
zend.script_encoding => no value => no value
ctype
ctype functions => enabled
date
date/time support => enabled
"Olson" Timezone Database Version => 2016.10
Timezone Database => internal
Default timezone => UTC
Directive => Local Value => Master Value
date.default_latitude => 31.7667 => 31.7667
date.default_longitude => 35.2333 => 35.2333
date.sunrise_zenith => 90.583333 => 90.583333
date.sunset_zenith => 90.583333 => 90.583333
date.timezone => no value => no value
dom
DOM/XML => enabled
DOM/XML API Version => 20031129
libxml Version => 2.9.4
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
Schema Support => enabled
RelaxNG Support => enabled
fileinfo
fileinfo support => enabled
version => 1.0.5
libmagic => 522
filter
Input Validation and Filtering => enabled
Revision => $Id: 28fcca4bfda9c9907588a64d245b49cb398249d8 $
Directive => Local Value => Master Value
filter.default => unsafe_raw => unsafe_raw
filter.default_flags => no value => no value
hash
hash support => enabled
Hashing Engines => md2 md4 md5 sha1 sha224 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost gost-crypto adler32 crc32 crc32b fnv132 fnv1a32 fnv164 fnv1a64 joaat haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5
json
json support => enabled
json version => 1.4.0
libxml
libXML support => active
libXML Compiled Version => 2.9.4
libXML Loaded Version => 20904
libXML streams => enabled
pcre
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 8.38 2015-11-23
PCRE JIT Support => enabled
Directive => Local Value => Master Value
pcre.backtrack_limit => 1000000 => 1000000
pcre.jit => 1 => 1
pcre.recursion_limit => 100000 => 100000
PDO
PDO support => enabled
PDO drivers => sqlite
pdo_sqlite
PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.14.2
Phar
Phar: PHP Archive support => enabled
Phar EXT version => 2.0.2
Phar API version => 1.1.1
SVN revision => $Id: bf89220e0ebdb68ebb5379ffc0a32997f94e77e7 $
Phar-based phar archives => enabled
Tar-based phar archives => enabled
ZIP-based phar archives => enabled
gzip compression => disabled (install ext/zlib)
bzip2 compression => disabled (install pecl/bz2)
OpenSSL support => disabled (install ext/openssl)
Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
Directive => Local Value => Master Value
phar.cache_list => no value => no value
phar.readonly => On => On
phar.require_hash => On => On
posix
Revision => $Id: b691ca925e7a085e6929579c4eba8fed0732e0ef $
Reflection
Reflection => enabled
Version => $Id: 3054da9d8c9ebb2a7e0a7df1f0cdf3cbbe9f8bd8 $
session
Session Support => enabled
Registered save handlers => files user
Registered serializer handlers => php_serialize php php_binary
Directive => Local Value => Master Value
session.auto_start => Off => Off
session.cache_expire => 180 => 180
session.cache_limiter => nocache => nocache
session.cookie_domain => no value => no value
session.cookie_httponly => Off => Off
session.cookie_lifetime => 0 => 0
session.cookie_path => / => /
session.cookie_secure => Off => Off
session.entropy_file => /dev/urandom => /dev/urandom
session.entropy_length => 32 => 32
session.gc_divisor => 100 => 100
session.gc_maxlifetime => 1440 => 1440
session.gc_probability => 1 => 1
session.hash_bits_per_character => 4 => 4
session.hash_function => 0 => 0
session.lazy_write => On => On
session.name => PHPSESSID => PHPSESSID
session.referer_check => no value => no value
session.save_handler => files => files
session.save_path => no value => no value
session.serialize_handler => php => php
session.upload_progress.cleanup => On => On
session.upload_progress.enabled => On => On
session.upload_progress.freq => 1% => 1%
session.upload_progress.min_freq => 1 => 1
session.upload_progress.name => PHP_SESSION_UPLOAD_PROGRESS => PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix => upload_progress_ => upload_progress_
session.use_cookies => On => On
session.use_only_cookies => On => On
session.use_strict_mode => Off => Off
session.use_trans_sid => 0 => 0
SimpleXML
Simplexml support => enabled
Revision => $Id: b8b5c37931a53e50a937c0aef2a26d351e173215 $
Schema support => enabled
SPL
SPL support => enabled
Interfaces => Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException
sqlite3
SQLite3 support => enabled
SQLite3 module version => 0.7-dev
SQLite Library => 3.14.2
Directive => Local Value => Master Value
sqlite3.extension_dir => no value => no value
standard
Dynamic Library Support => enabled
Path to sendmail => /usr/sbin/sendmail -t -i
Directive => Local Value => Master Value
assert.active => 1 => 1
assert.bail => 0 => 0
assert.callback => no value => no value
assert.exception => 0 => 0
assert.quiet_eval => 0 => 0
assert.warning => 1 => 1
auto_detect_line_endings => 0 => 0
default_socket_timeout => 60 => 60
from => no value => no value
url_rewriter.tags => a=href,area=href,frame=src,form=,fieldset= => a=href,area=href,frame=src,form=,fieldset=
user_agent => no value => no value
tokenizer
Tokenizer Support => enabled
xml
XML Support => active
XML Namespace Support => active
libxml2 Version => 2.9.4
xmlreader
XMLReader => enabled
xmlwriter
XMLWriter => enabled
Additional Modules
Module Name
Environment
Variable => Value
rvm_bin_path => /Users/hznk/.rvm/bin
TERM_PROGRAM => Apple_Terminal
GEM_HOME => /Users/hznk/.rvm/gems/ruby-2.3.1
SHELL => /bin/bash
TERM => xterm-256color
IRBRC => /Users/hznk/.rvm/rubies/ruby-2.3.1/.irbrc
TMPDIR => /var/folders/4v/kht4d5qn0j72c3gt9qtcsjl80000gn/T/
Apple_PubSub_Socket_Render => /private/tmp/com.apple.launchd.zAbLo6t0xL/Render
TERM_PROGRAM_VERSION => 400
OLDPWD => /Users/hznk
MY_RUBY_HOME => /Users/hznk/.rvm/rubies/ruby-2.3.1
TERM_SESSION_ID => 53575832-8EDD-4165-BB5A-31CD66A41C40
USER => hznk
_system_type => Darwin
rvm_path => /Users/hznk/.rvm
SSH_AUTH_SOCK => /private/tmp/com.apple.launchd.46FwM34Zls/Listeners
rvm_prefix => /Users/hznk
PATH => /Users/hznk/anaconda2/bin:/opt/local/bin:/opt/local/sbin:/Users/hznk/.composer/vendor/bin:/Users/hznk/.rvm/gems/ruby-2.3.1/bin:/Users/hznk/.rvm/gems/ruby-2.3.1#global/bin:/Users/hznk/.rvm/rubies/ruby-2.3.1/bin:/Users/hznk/.rbenv/shims:/Users/hznk/.rbenv/shims:/Users/hznk/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/hznk/.rvm/bin:/opt/metasploit-framework/bin:/opt/metasploit-framework/bin
PWD => /Applications/XAMPP/htdocs/fraudet
_system_arch => x86_64
XPC_FLAGS => 0x0
_system_version => 10.13
RBENV_SHELL => bash
XPC_SERVICE_NAME => 0
rvm_version => 1.27.0 (latest)
SHLVL => 1
HOME => /Users/hznk
LOGNAME => hznk
GEM_PATH => /Users/hznk/.rvm/gems/ruby-2.3.1:/Users/hznk/.rvm/gems/ruby-2.3.1#global
LC_CTYPE => UTF-8
DISPLAY => /private/tmp/com.apple.launchd.mAwrunwzZa/org.macosforge.xquartz:0
RUBY_VERSION => ruby-2.3.1
_system_name => OSX
_ => /usr/local/bin/php
PHP Variables
Variable => Value
$_SERVER['rvm_bin_path'] => /Users/hznk/.rvm/bin
$_SERVER['TERM_PROGRAM'] => Apple_Terminal
$_SERVER['GEM_HOME'] => /Users/hznk/.rvm/gems/ruby-2.3.1
$_SERVER['SHELL'] => /bin/bash
$_SERVER['TERM'] => xterm-256color
$_SERVER['IRBRC'] => /Users/hznk/.rvm/rubies/ruby-2.3.1/.irbrc
$_SERVER['TMPDIR'] => /var/folders/4v/kht4d5qn0j72c3gt9qtcsjl80000gn/T/
$_SERVER['Apple_PubSub_Socket_Render'] => /private/tmp/com.apple.launchd.zAbLo6t0xL/Render
$_SERVER['TERM_PROGRAM_VERSION'] => 400
$_SERVER['OLDPWD'] => /Users/hznk
$_SERVER['MY_RUBY_HOME'] => /Users/hznk/.rvm/rubies/ruby-2.3.1
$_SERVER['TERM_SESSION_ID'] => 53575832-8EDD-4165-BB5A-31CD66A41C40
$_SERVER['USER'] => hznk
$_SERVER['_system_type'] => Darwin
$_SERVER['rvm_path'] => /Users/hznk/.rvm
$_SERVER['SSH_AUTH_SOCK'] => /private/tmp/com.apple.launchd.46FwM34Zls/Listeners
$_SERVER['rvm_prefix'] => /Users/hznk
$_SERVER['PATH'] => /Users/hznk/anaconda2/bin:/opt/local/bin:/opt/local/sbin:/Users/hznk/.composer/vendor/bin:/Users/hznk/.rvm/gems/ruby-2.3.1/bin:/Users/hznk/.rvm/gems/ruby-2.3.1#global/bin:/Users/hznk/.rvm/rubies/ruby-2.3.1/bin:/Users/hznk/.rbenv/shims:/Users/hznk/.rbenv/shims:/Users/hznk/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/hznk/.rvm/bin:/opt/metasploit-framework/bin:/opt/metasploit-framework/bin
$_SERVER['PWD'] => /Applications/XAMPP/htdocs/fraudet
$_SERVER['_system_arch'] => x86_64
$_SERVER['XPC_FLAGS'] => 0x0
$_SERVER['_system_version'] => 10.13
$_SERVER['RBENV_SHELL'] => bash
$_SERVER['XPC_SERVICE_NAME'] => 0
$_SERVER['rvm_version'] => 1.27.0 (latest)
$_SERVER['SHLVL'] => 1
$_SERVER['HOME'] => /Users/hznk
$_SERVER['LOGNAME'] => hznk
$_SERVER['GEM_PATH'] => /Users/hznk/.rvm/gems/ruby-2.3.1:/Users/hznk/.rvm/gems/ruby-2.3.1#global
$_SERVER['LC_CTYPE'] => UTF-8
$_SERVER['DISPLAY'] => /private/tmp/com.apple.launchd.mAwrunwzZa/org.macosforge.xquartz:0
$_SERVER['RUBY_VERSION'] => ruby-2.3.1
$_SERVER['_system_name'] => OSX
$_SERVER['_'] => /usr/local/bin/php
$_SERVER['PHP_SELF'] => test.php
$_SERVER['SCRIPT_NAME'] => test.php
$_SERVER['SCRIPT_FILENAME'] => test.php
$_SERVER['PATH_TRANSLATED'] => test.php
$_SERVER['DOCUMENT_ROOT'] =>
$_SERVER['REQUEST_TIME_FLOAT'] => 1514551615.1487
$_SERVER['REQUEST_TIME'] => 1514551615
$_SERVER['argv'] => Array
(
[0] => test.php
)
$_SERVER['argc'] => 1
$_ENV['rvm_bin_path'] => /Users/hznk/.rvm/bin
$_ENV['TERM_PROGRAM'] => Apple_Terminal
$_ENV['GEM_HOME'] => /Users/hznk/.rvm/gems/ruby-2.3.1
$_ENV['SHELL'] => /bin/bash
$_ENV['TERM'] => xterm-256color
$_ENV['IRBRC'] => /Users/hznk/.rvm/rubies/ruby-2.3.1/.irbrc
$_ENV['TMPDIR'] => /var/folders/4v/kht4d5qn0j72c3gt9qtcsjl80000gn/T/
$_ENV['Apple_PubSub_Socket_Render'] => /private/tmp/com.apple.launchd.zAbLo6t0xL/Render
$_ENV['TERM_PROGRAM_VERSION'] => 400
$_ENV['OLDPWD'] => /Users/hznk
$_ENV['MY_RUBY_HOME'] => /Users/hznk/.rvm/rubies/ruby-2.3.1
$_ENV['TERM_SESSION_ID'] => 53575832-8EDD-4165-BB5A-31CD66A41C40
$_ENV['USER'] => hznk
$_ENV['_system_type'] => Darwin
$_ENV['rvm_path'] => /Users/hznk/.rvm
$_ENV['SSH_AUTH_SOCK'] => /private/tmp/com.apple.launchd.46FwM34Zls/Listeners
$_ENV['rvm_prefix'] => /Users/hznk
$_ENV['PATH'] => /Users/hznk/anaconda2/bin:/opt/local/bin:/opt/local/sbin:/Users/hznk/.composer/vendor/bin:/Users/hznk/.rvm/gems/ruby-2.3.1/bin:/Users/hznk/.rvm/gems/ruby-2.3.1#global/bin:/Users/hznk/.rvm/rubies/ruby-2.3.1/bin:/Users/hznk/.rbenv/shims:/Users/hznk/.rbenv/shims:/Users/hznk/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/hznk/.rvm/bin:/opt/metasploit-framework/bin:/opt/metasploit-framework/bin
$_ENV['PWD'] => /Applications/XAMPP/htdocs/fraudet
$_ENV['_system_arch'] => x86_64
$_ENV['XPC_FLAGS'] => 0x0
$_ENV['_system_version'] => 10.13
$_ENV['RBENV_SHELL'] => bash
$_ENV['XPC_SERVICE_NAME'] => 0
$_ENV['rvm_version'] => 1.27.0 (latest)
$_ENV['SHLVL'] => 1
$_ENV['HOME'] => /Users/hznk
$_ENV['LOGNAME'] => hznk
$_ENV['GEM_PATH'] => /Users/hznk/.rvm/gems/ruby-2.3.1:/Users/hznk/.rvm/gems/ruby-2.3.1#global
$_ENV['LC_CTYPE'] => UTF-8
$_ENV['DISPLAY'] => /private/tmp/com.apple.launchd.mAwrunwzZa/org.macosforge.xquartz:0
$_ENV['RUBY_VERSION'] => ruby-2.3.1
$_ENV['_system_name'] => OSX
$_ENV['_'] => /usr/local/bin/php
I am wondering if anyone could help me with this problem. Thank you.
Note: I am using mac high Sierra and my php version is 7.0.15
oh nevermind, I found out php.ini that I use was blank. So I tried to copied from the one in XAMPP. When I run php artisan migrate it shows
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pdo_pgsql.dll' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pdo_pgsql.dll, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pdo_pgsql.dll' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pdo_pgsql.dll, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pgsql.dll' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pgsql.dll, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pgsql.dll' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pgsql.dll, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pgsql.so' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pgsql.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pgsql.so' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pgsql.so, 9): image not found in Unknown on line 0
PHP Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/Mbstring.php:113
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/bootstrap.php(19): Symfony\Polyfill\Mbstring\Mbstring::mb_convert_encoding('Call to undefin...', 'UTF-8', 'ASCII')
#1 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(1157): mb_convert_encoding('Call to undefin...', 'utf8', 'ASCII')
#2 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(745): Symfony\Component\Console\Application->splitStringByWidth('Call to undefin...', 75)
#3 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(719): Symfony\Component\Console\Application->doRenderException(Object(Symfony\Component\Debug\Exception\FatalThrowableError), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /Applications/XAMPP/xamppfiles/ht in /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/Mbstring.php on line 113
PHP Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/Mbstring.php:113
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/bootstrap.php(19): Symfony\Polyfill\Mbstring\Mbstring::mb_convert_encoding('Uncaught Error:...', 'UTF-8', 'ASCII')
#1 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(1157): mb_convert_encoding('Uncaught Error:...', 'utf8', 'ASCII')
#2 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(745): Symfony\Component\Console\Application->splitStringByWidth('Uncaught Error:...', 75)
#3 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(719): Symfony\Component\Console\Application->doRenderException(Object(Symfony\Component\Debug\Exception\FatalErrorException), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /Applications/XAMPP/xamppfiles/ht in /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/Mbstring.php on line 113
hznk:fraudet hznk$ php artisan migrate
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pdo_pgsql.dll' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pdo_pgsql.dll, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pdo_pgsql.dll' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pdo_pgsql.dll, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pgsql.dll' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pgsql.dll, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pgsql.dll' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/php_pgsql.dll, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pgsql.so' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pgsql.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pgsql.so' - dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pgsql.so, 9): image not found in Unknown on line 0
PHP Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/Mbstring.php:113
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/bootstrap.php(19): Symfony\Polyfill\Mbstring\Mbstring::mb_convert_encoding('Call to undefin...', 'UTF-8', 'ASCII')
#1 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(1157): mb_convert_encoding('Call to undefin...', 'utf8', 'ASCII')
#2 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(745): Symfony\Component\Console\Application->splitStringByWidth('Call to undefin...', 75)
#3 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(719): Symfony\Component\Console\Application->doRenderException(Object(Symfony\Component\Debug\Exception\FatalThrowableError), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /Applications/XAMPP/xamppfiles/ht in /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/Mbstring.php on line 113
PHP Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/Mbstring.php:113
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/bootstrap.php(19): Symfony\Polyfill\Mbstring\Mbstring::mb_convert_encoding('Uncaught Error:...', 'UTF-8', 'ASCII')
#1 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(1157): mb_convert_encoding('Uncaught Error:...', 'utf8', 'ASCII')
#2 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(745): Symfony\Component\Console\Application->splitStringByWidth('Uncaught Error:...', 75)
#3 /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/console/Application.php(719): Symfony\Component\Console\Application->doRenderException(Object(Symfony\Component\Debug\Exception\FatalErrorException), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /Applications/XAMPP/xamppfiles/ht in /Applications/XAMPP/xamppfiles/htdocs/fraudet/vendor/symfony/polyfill-mbstring/Mbstring.php on line 113
at least it shows something. Gotta work on this first and I'll let you know if I succeed with this problem.

Why does my php page seem to load async?

I have two cpanel websites running the same php script that parses a csv file, one on godaddy servers (site A), one on hostgator (site B). on site B, the html portion of the page renders and then it parses the csv, while on site A it parses the csv and then renders the html portion.
Any ideas why there is such different behavior? I would like to have Site A perform this script like Site B
They are both running php 5.4 and have the same execution time limits.
Below are the result of array_diff_assoc of php.ini arrays of name => local_value. The first is array_diff_assoc(Site B, Site A) the second is array_diff_assoc(Site A, Site B)
Array
(
[allow_url_include] => 1
[date.timezone] => America/Chicago
[disable_functions] => dl
[enable_dl] =>
[error_reporting] => 22519
[expose_php] =>
[extension_dir] => /opt/php54/lib/php/extensions/no-debug-non-zts-20100525
[include_path] => .:/opt/php54/lib/php
[intl.default_locale] =>
[intl.error_level] => 0
[max_execution_time] => 30
[memory_limit] => 256M
[mssql.allow_persistent] => 1
[mssql.batchsize] => 0
[mssql.charset] =>
[mssql.compatability_mode] =>
[mssql.connect_timeout] => 5
[mssql.datetimeconvert] => 1
[mssql.max_links] => -1
[mssql.max_persistent] => -1
[mssql.max_procs] => -1
[mssql.min_error_severity] => 10
[mssql.min_message_severity] => 10
[mssql.secure_connection] =>
[mssql.textlimit] => -1
[mssql.textsize] => -1
[mssql.timeout] => 60
[mysql.allow_persistent] =>
[odbc.allow_persistent] =>
[odbc.check_persistent] =>
[odbc.default_cursortype] => 3
[odbc.default_db] =>
[odbc.default_pw] =>
[odbc.default_user] =>
[odbc.defaultbinmode] => 1
[odbc.defaultlrl] => 4096
[odbc.max_links] => -1
[odbc.max_persistent] => -1
[pcre.backtrack_limit] => 1000000
[pcre.recursion_limit] => 100000
[post_max_size] => 64M
[sourceguardian.restrict_unencoded] => 0
[upload_max_filesize] => 64M
[xsl.security_prefs] => 44
)
Array
(
[allow_url_include] => 0
[apc.cache_by_default] => 1
[apc.canonicalize] => 1
[apc.coredump_unmap] => 0
[apc.enable_cli] => 0
[apc.enabled] => 1
[apc.file_md5] => 0
[apc.file_update_protection] => 2
[apc.filters] =>
[apc.gc_ttl] => 3600
[apc.include_once_override] => 0
[apc.lazy_classes] => 0
[apc.lazy_functions] => 0
[apc.max_file_size] => 1M
[apc.mmap_file_mask] =>
[apc.num_files_hint] => 1000
[apc.preload_path] =>
[apc.report_autofilter] => 0
[apc.rfc1867] => 0
[apc.rfc1867_freq] => 0
[apc.rfc1867_name] => APC_UPLOAD_PROGRESS
[apc.rfc1867_prefix] => upload_
[apc.rfc1867_ttl] => 3600
[apc.serializer] => default
[apc.shm_segments] => 1
[apc.shm_size] => 32M
[apc.shm_strings_buffer] => 4M
[apc.slam_defense] => 1
[apc.stat] => 1
[apc.stat_ctime] => 0
[apc.ttl] => 0
[apc.use_request_time] => 1
[apc.user_entries_hint] => 4096
[apc.user_ttl] => 0
[apc.write_lock] => 1
[date.timezone] => UTC
[disable_functions] =>
[enable_dl] => 1
[error_reporting] => 1
[expose_php] => 1
[extension_dir] => /usr/local/lib/php/extensions/no-debug-non-zts-20100525
[include_path] => .:/usr/lib/php:/usr/local/lib/php
[max_execution_time] => 120
[memory_limit] => 64M
[mysql.allow_persistent] => 1
[mysqlnd.collect_memory_statistics] => 0
[mysqlnd.collect_statistics] => 1
[mysqlnd.debug] =>
[mysqlnd.log_mask] => 0
[mysqlnd.mempool_default_size] => 16000
[mysqlnd.net_cmd_buffer_size] => 4096
[mysqlnd.net_read_buffer_size] => 32768
[mysqlnd.net_read_timeout] => 31536000
[pcre.backtrack_limit] => 10000000
[pcre.recursion_limit] => 10000000
[post_max_size] => 48M
[upload_max_filesize] => 32M
)
Update 1
In comparing ini_get_all, I have found that Site A has APC enabled where Site B does not... could this be the issue? Is there any harm in this implementation in disabling APC?
Update 2
I believe we can rule out implicit_flush, as both are set to false and setting Site A's to true does not change the behavior
Update 3
Included the differences in ini files
Update 4
I have set Site A's php.ini file to be the same as site B's, with no change in behavior, so maybe we can rule this out?
Update 5
Although it does not mimic the async nature of site B, using
ob_flush();
flush();
to flush the buffer seems to get it very close, but it is not a very clean solution...

Categories